mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 14:05:39 +00:00
WORKFLOW: fixing the source branch fetch [skip ci]
This commit is contained in:
parent
3ed0a02abe
commit
da32df40a0
|
@ -46,6 +46,33 @@ jobs:
|
||||||
- name: Generate cooker build ID
|
- name: Generate cooker build ID
|
||||||
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_build_id.sh"
|
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_build_id.sh"
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: branch_name
|
||||||
|
run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# if it's a feature branch it will not marked as "latest" cooker version
|
||||||
|
- name: "Set makeLatest (cooker only)"
|
||||||
|
run: |
|
||||||
|
if [[ "$BRANCH_NAME" == 'feat/'* || "$BRANCH_NAME" == 'refs/'* ]]; then
|
||||||
|
echo "MAKE_LATEST=false" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "MAKE_LATEST=true" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if the branch is coming from a PR the tag should be manually built
|
||||||
|
- name: "Generate version tag"
|
||||||
|
run: |
|
||||||
|
if [[ "$BRANCH_NAME" == 'refs/'* ]]; then
|
||||||
|
pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}')
|
||||||
|
source_branch=$(git show "refs/pull/$pr_number/merge" --no-patch --format="%P" | cut -d' ' -f2 | cut -d'/' -f3)
|
||||||
|
source_branch=${source_branch//\//-}
|
||||||
|
echo "[DEBUG] source branch is: $source_branch"
|
||||||
|
echo "TAG=PR-$pr_number-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "TAG=${{env.BRANCH_NAME}}-${{ env.buildid }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
echo "Version TAG: ${{ env.TAG }}"
|
||||||
|
|
||||||
# backing up manifest in case download fails and hashes must be recalculated
|
# backing up manifest in case download fails and hashes must be recalculated
|
||||||
- name: Manifest backup
|
- name: Manifest backup
|
||||||
run: "cp ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml.bak"
|
run: "cp ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml.bak"
|
||||||
|
@ -106,30 +133,6 @@ jobs:
|
||||||
id: commits
|
id: commits
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Get branch name
|
|
||||||
id: branch_name
|
|
||||||
run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# if it's a feature branch it will not marked as "latest" cooker version
|
|
||||||
- name: "Set makeLatest (cooker only)"
|
|
||||||
run: |
|
|
||||||
if [[ "$BRANCH_NAME" == 'feat/'* || "$BRANCH_NAME" == 'ref/'* ]]; then
|
|
||||||
echo "MAKE_LATEST=false" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "MAKE_LATEST=true" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if the branch is coming from a PR the tag should be manually built
|
|
||||||
- name: "Generate version tag"
|
|
||||||
run: |
|
|
||||||
if [[ "$BRANCH_NAME" == 'refs/'* ]]; then
|
|
||||||
pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}')
|
|
||||||
original_branch=$(git ls-remote --heads origin "refs/pull/$pr_number/head" | cut -d'/' -f3)
|
|
||||||
echo "TAG=PR-$pr_number-$original_branch-${{ env.buildid }}" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "TAG=${{env.BRANCH_NAME}}-${{ env.buildid }}" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Publish the flatpak in a new cooker release
|
- name: Publish the flatpak in a new cooker release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in a new issue