From 018758d5b9d177edcb7fd22ce930ec889bedc170 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 17 Jul 2024 21:18:19 +0900 Subject: [PATCH 01/14] WORKFLOW: integrating new versioning flow with tags and single cooker branch --- .github/workflows/cooker-selfhosted.yml | 14 +++++++++++++- .github/workflows/main-selfhosted.yml | 10 ++++++++++ automation_tools/main_version_checker.sh | 4 ++-- net.retrodeck.retrodeck.yml | 4 ++-- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index cf831cf8..72998b32 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -64,6 +64,8 @@ jobs: # if the branch is coming from a PR the tag should be manually built - name: "Generate version tag" run: | + source automation_tools/version_extractor.sh + manifest_version=$(fetch_manifest_version) if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') @@ -71,7 +73,7 @@ jobs: 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 + echo "TAG=${{$manifest_version}}-${{ env.buildid }}" >> $GITHUB_ENV fi echo "Version TAG: ${{ env.TAG }}" @@ -159,6 +161,16 @@ jobs: repo: RetroDECK-cooker continue-on-error: true + - name: Rewrite Tag + run: | + git fetch --tags + if git rev-parse --verify "${{ env.TAG }}" >/dev/null 2>&1; then # if the tag exists + git tag -d "${{ env.TAG }}" # remove it from local repo + git push --delete origin "${{ env.TAG }}" # and from remote + fi + git tag "${{ env.TAG }}" # Create the tag locally + git push origin "${{ env.TAG }}" # Push the new tag in the remote repo + # In case it cannot publish the release at least it's providing the flatpak file for creating a manual release - name: Upload RetroDECK-cooker.flatpak uses: actions/upload-artifact@v3 diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index c1932daf..47215544 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -115,6 +115,16 @@ jobs: repo: RetroDECK continue-on-error: true + - name: Rewrite Tag + run: | + git fetch --tags + if git rev-parse --verify "${{ env.REL_VER }}" >/dev/null 2>&1; then # if the tag exists + git tag -d "${{ env.REL_VER }}" # remove it from local repo + git push --delete origin "${{ env.REL_VER }}" # and from remote + fi + git tag "${{ env.REL_VER }}" # Create the tag locally + git push origin "${{ env.REL_VER }}" # Push the new tag in the remote repo + # In case it cannot publish the release at least it's providing the flatpak file for creating a manual release - name: Upload RetroDECK.flatpak uses: actions/upload-artifact@v3 diff --git a/automation_tools/main_version_checker.sh b/automation_tools/main_version_checker.sh index 87011bfd..d230b205 100755 --- a/automation_tools/main_version_checker.sh +++ b/automation_tools/main_version_checker.sh @@ -42,8 +42,8 @@ appdata_version=$(fetch_appdata_version) echo -e "Appdata:\t\t$appdata_version" # Additional checks -if [[ "$manifest_version" == "main" || "$manifest_version" == "THISBRANCH" ]]; then - echo "Manifest version cannot be 'main' or 'THISBRANCH'. Please fix it." +if [[ "$manifest_version" == "main" || "$manifest_version" == "THISBRANCH" || "$manifest_version" == *"cooker"* ]]; then + echo "Manifest version cannot be 'main', 'THISBRANCH', or contain 'cooker'. Please fix it." exit 1 fi diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 485ca13c..5d8073c0 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -77,8 +77,8 @@ modules: - | # on main please update this with the version variable, eg: VERSION=0.8.0b - # on cooker will be THISBRANCH - VERSION=THISBRANCH + # on cooker will be VERSION=cooker-0.9.0b for example + VERSION=cooker-0.9.0b git checkout ${GITHUB_REF_NAME} mkdir -p ${FLATPAK_DEST}/retrodeck/ From b69992ccd18d568b922a59cd366907d714d34b3a Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 17 Jul 2024 23:14:28 +0900 Subject: [PATCH 02/14] WORKLFOW: comtinue on error for gitea [skip ci] --- .github/workflows/main-selfhosted.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 47215544..3626ff93 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -176,6 +176,7 @@ jobs: -H "Content-Type: multipart/form-data" \ -F "attachment=@RetroDECK-Artifact.tar.gz" \ "http://$UPLOAD_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-Artifact.tar.gz" + continue-on-error: true # this will be in place until we reate an artifacts website that bypasses cloudflare limit - name: Upload RetroDECK.flatpak.sha to Gitea Release run: | From cdbb410de4a892828e7e66281d5c188aa0016687 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 09:09:31 +0900 Subject: [PATCH 03/14] DOLPHIN: bumped to 2407-68 to fix RA --- net.retrodeck.retrodeck.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 5d8073c0..521de888 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -78,7 +78,7 @@ modules: # on main please update this with the version variable, eg: VERSION=0.8.0b # on cooker will be VERSION=cooker-0.9.0b for example - VERSION=cooker-0.9.0b + VERSION=cooker-0.8.2b git checkout ${GITHUB_REF_NAME} mkdir -p ${FLATPAK_DEST}/retrodeck/ @@ -716,7 +716,7 @@ modules: # fatal: remote transport reported error # url: ssh://git@github.com/dolphin-emu/dolphin.git url: https://github.com/dolphin-emu/dolphin.git - commit: 505fe5cc0e3123746e673ecca77c04ec72ff106f + commit: cc3ff347b437fd80f3a2880d1bbc7ba2d5f191f4 # x-checker-data: # type: json # url: https://dolphin-emu.org/update/latest/beta From ef5ff4a8a4378b0885124012502b7b49beabb98c Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 09:18:50 +0900 Subject: [PATCH 04/14] WORKFLOW: integrating new versioning flow with tags and single cooker branch - fix --- .github/workflows/cooker-selfhosted.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 72998b32..a9c5b7f2 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -65,7 +65,7 @@ jobs: - name: "Generate version tag" run: | source automation_tools/version_extractor.sh - manifest_version=$(fetch_manifest_version) + manifest_version=${$fetch_manifest_version} if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') From 3adc2feba8558c1423a772688d6fd6d4ba0ea936 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 09:21:31 +0900 Subject: [PATCH 05/14] WORKFLOW: integrating new versioning flow with tags and single cooker branch - fix2 --- .github/workflows/cooker-selfhosted.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index a9c5b7f2..bf1ae8cd 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -65,7 +65,7 @@ jobs: - name: "Generate version tag" run: | source automation_tools/version_extractor.sh - manifest_version=${$fetch_manifest_version} + manifest_version="$($fetch_manifest_version)" if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') From a5f0ae5ce97723c8781e15b54f5af09c0dd94d92 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 09:25:48 +0900 Subject: [PATCH 06/14] WORKFLOW: integrating new versioning flow with tags and single cooker branch - fix3 --- .github/workflows/cooker-selfhosted.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index bf1ae8cd..84c8bf7d 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -65,7 +65,7 @@ jobs: - name: "Generate version tag" run: | source automation_tools/version_extractor.sh - manifest_version="$($fetch_manifest_version)" + echo "MANIFEST_VERSION=$($fetch_manifest_version)" >> $GITHUB_ENV if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') @@ -73,7 +73,7 @@ jobs: echo "[DEBUG] source branch is: $source_branch" echo "TAG=PR-$pr_number-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV else - echo "TAG=${{$manifest_version}}-${{ env.buildid }}" >> $GITHUB_ENV + echo "TAG=${{ env.MANIFEST_VERSION }}-${{ env.buildid }}" >> $GITHUB_ENV fi echo "Version TAG: ${{ env.TAG }}" From 5d65c6e12af0247c515681d66400e8249124f492 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:23:28 +0900 Subject: [PATCH 07/14] WORKFLOW: fixing version extrator --- .github/workflows/cooker-selfhosted.yml | 3 ++- .github/workflows/main-selfhosted.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 84c8bf7d..64640af6 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -64,7 +64,7 @@ jobs: # if the branch is coming from a PR the tag should be manually built - name: "Generate version tag" run: | - source automation_tools/version_extractor.sh + /bin/bash automation_tools/version_extractor.sh echo "MANIFEST_VERSION=$($fetch_manifest_version)" >> $GITHUB_ENV if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') @@ -163,6 +163,7 @@ jobs: - name: Rewrite Tag run: | + git submodule deinit -f --all git fetch --tags if git rev-parse --verify "${{ env.TAG }}" >/dev/null 2>&1; then # if the tag exists git tag -d "${{ env.TAG }}" # remove it from local repo diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 3626ff93..a98b3360 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -117,6 +117,7 @@ jobs: - name: Rewrite Tag run: | + git submodule deinit -f --all git fetch --tags if git rev-parse --verify "${{ env.REL_VER }}" >/dev/null 2>&1; then # if the tag exists git tag -d "${{ env.REL_VER }}" # remove it from local repo From 4e81b3b8ee4ab976a5451fdec19d906babb6d300 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:25:52 +0900 Subject: [PATCH 08/14] VERSION_EXTRACTOR: added debug output --- automation_tools/version_extractor.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automation_tools/version_extractor.sh b/automation_tools/version_extractor.sh index b9f679ff..f4714575 100755 --- a/automation_tools/version_extractor.sh +++ b/automation_tools/version_extractor.sh @@ -32,3 +32,5 @@ fetch_manifest_version(){ manifest_version=$(echo "$manifest_version" | awk '{$1=$1;print}') echo "$manifest_version" } + +echo "Version extractor functions loaded" \ No newline at end of file From 20789a3afa52d778269ef10990e67aa9baf623a5 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:32:16 +0900 Subject: [PATCH 09/14] WORKFLOW: fixing version extrator - fix2 --- .github/workflows/cooker-selfhosted.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 64640af6..d068989a 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -64,8 +64,8 @@ jobs: # if the branch is coming from a PR the tag should be manually built - name: "Generate version tag" run: | - /bin/bash automation_tools/version_extractor.sh - echo "MANIFEST_VERSION=$($fetch_manifest_version)" >> $GITHUB_ENV + source automation_tools/version_extractor.sh + echo "MANIFEST_VERSION=$(fetch_manifest_version)" >> $GITHUB_ENV if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') From 16c70c824219aff7476e65da3bcb7e8ca5ecfb34 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:35:01 +0900 Subject: [PATCH 10/14] WORKFLOW: fixing version extrator - debug --- .github/workflows/cooker-selfhosted.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index d068989a..7a176d62 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -65,6 +65,8 @@ jobs: - name: "Generate version tag" run: | source automation_tools/version_extractor.sh + MANIFEST_VERSION="$(fetch_manifest_version)" + echo "$MANIFEST_VERSION" echo "MANIFEST_VERSION=$(fetch_manifest_version)" >> $GITHUB_ENV if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') From 8682761c6c5a0cc9f791631162d2f2de0579e57b Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:36:52 +0900 Subject: [PATCH 11/14] WORKFLOW: fixing version extrator - fix3 --- .github/workflows/cooker-selfhosted.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 7a176d62..43b4c11f 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -66,8 +66,7 @@ jobs: run: | source automation_tools/version_extractor.sh MANIFEST_VERSION="$(fetch_manifest_version)" - echo "$MANIFEST_VERSION" - echo "MANIFEST_VERSION=$(fetch_manifest_version)" >> $GITHUB_ENV + echo "MANIFEST_VERSION=$MANIFEST_VERSION" >> $GITHUB_ENV if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') From 46d1c144571866878f08a1e4b2ae84bd605ecb12 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:38:46 +0900 Subject: [PATCH 12/14] WORKFLOW: fixing version extrator - fix4 --- .github/workflows/cooker-selfhosted.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 43b4c11f..9e200b35 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -74,7 +74,7 @@ jobs: echo "[DEBUG] source branch is: $source_branch" echo "TAG=PR-$pr_number-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV else - echo "TAG=${{ env.MANIFEST_VERSION }}-${{ env.buildid }}" >> $GITHUB_ENV + echo "TAG=$MANIFEST_VERSION-${{ env.buildid }}" >> $GITHUB_ENV fi echo "Version TAG: ${{ env.TAG }}" From 2bf6530c58f02122b8662ea778aedde5f671cc60 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:40:36 +0900 Subject: [PATCH 13/14] WORKFLOW: fixing version extrator - fix5 --- .github/workflows/cooker-selfhosted.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 9e200b35..d324dd8a 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -76,7 +76,8 @@ jobs: else echo "TAG=$MANIFEST_VERSION-${{ env.buildid }}" >> $GITHUB_ENV fi - echo "Version TAG: ${{ env.TAG }}" + echo "MANIFEST_VERSION: $MANIFEST_VERSION" + echo "Version TAG: $TAG" # backing up manifest in case download fails and hashes must be recalculated - name: Manifest backup From 90f25746a2e078ad15e5f747fdcc2a26cdfc7d57 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 18 Jul 2024 13:42:57 +0900 Subject: [PATCH 14/14] WORKFLOW: fixing version extrator - fix6 --- .github/workflows/cooker-selfhosted.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index d324dd8a..8dfc36fa 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -74,7 +74,8 @@ jobs: echo "[DEBUG] source branch is: $source_branch" echo "TAG=PR-$pr_number-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV else - echo "TAG=$MANIFEST_VERSION-${{ env.buildid }}" >> $GITHUB_ENV + TAG="$MANIFEST_VERSION-${{ env.buildid }}" + echo "TAG=$TAG" >> $GITHUB_ENV fi echo "MANIFEST_VERSION: $MANIFEST_VERSION" echo "Version TAG: $TAG"