From eda0c80cb117d8d699771df08b71fe93e47ef2fe Mon Sep 17 00:00:00 2001 From: Anil Kumar Beesetti Date: Mon, 23 Dec 2024 17:37:06 +0530 Subject: [PATCH 1/4] fix issue with github actions --- .github/workflows/update_version_and_publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_version_and_publish.yaml b/.github/workflows/update_version_and_publish.yaml index 57b1ce562..adf4a2e14 100644 --- a/.github/workflows/update_version_and_publish.yaml +++ b/.github/workflows/update_version_and_publish.yaml @@ -27,7 +27,7 @@ jobs: BASE_VERSION="${{ github.event.inputs.version }}" BRANCH_NAME="release/v${BASE_VERSION}" - git fetch origin release/${BASE_VERSION} || git fetch --all + git fetch origin ${BRANCH_NAME} || git fetch --all if git rev-parse --verify origin/${BRANCH_NAME} >/dev/null 2>&1; then echo "Branch ${BRANCH_NAME} exists, checking out..." @@ -37,7 +37,7 @@ jobs: git checkout -b ${BRANCH_NAME} fi - CURRENT_RC=$(git tag -l "${BASE_VERSION}-rc*" | sort | tail -n 1) + CURRENT_RC=$(git tag -l "v${BASE_VERSION}-rc*" | sort | tail -n 1) if [[ -z "$CURRENT_RC" ]]; then RC_SUFFIX="-rc01" else From 6ebc6b91dd6ed565782d31f795078bc42717ec76 Mon Sep 17 00:00:00 2001 From: Anil Kumar Beesetti Date: Tue, 24 Dec 2024 09:36:27 +0530 Subject: [PATCH 2/4] fetch all from git --- .github/workflows/update_version_and_publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_version_and_publish.yaml b/.github/workflows/update_version_and_publish.yaml index adf4a2e14..139498d2b 100644 --- a/.github/workflows/update_version_and_publish.yaml +++ b/.github/workflows/update_version_and_publish.yaml @@ -27,7 +27,7 @@ jobs: BASE_VERSION="${{ github.event.inputs.version }}" BRANCH_NAME="release/v${BASE_VERSION}" - git fetch origin ${BRANCH_NAME} || git fetch --all + git fetch --all if git rev-parse --verify origin/${BRANCH_NAME} >/dev/null 2>&1; then echo "Branch ${BRANCH_NAME} exists, checking out..." From 6fb097fd0f68da98734e1bf7b66745aa8e4670c8 Mon Sep 17 00:00:00 2001 From: Anil Kumar Beesetti Date: Tue, 24 Dec 2024 09:43:53 +0530 Subject: [PATCH 3/4] move commit and push changes step to last --- .../workflows/update_version_and_publish.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update_version_and_publish.yaml b/.github/workflows/update_version_and_publish.yaml index 139498d2b..1c2873f20 100644 --- a/.github/workflows/update_version_and_publish.yaml +++ b/.github/workflows/update_version_and_publish.yaml @@ -69,15 +69,6 @@ jobs: sed -i "s/versionCode = [0-9]\+/versionCode = ${{ env.VERSION_CODE }}/g" app/build.gradle.kts sed -i "s/versionName = \"[^\"]*\"/versionName = \"${{ env.VERSION_NAME }}\"/g" app/build.gradle.kts - - name: Commit and Push Changes - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - git add . - git commit -m "Release version ${{ env.VERSION_NAME }}" || echo "No changes to commit" - git config push.autoSetupRemote true - git push --set-upstream origin ${BRANCH_NAME} - - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -137,6 +128,15 @@ jobs: mv app/build/outputs/apk/release/app-x86-release.apk app/build/outputs/apk/release/nextplayer-v${{ env.VERSION_NAME }}-x86.apk mv app/build/outputs/apk/release/app-x86_64-release.apk app/build/outputs/apk/release/nextplayer-v${{ env.VERSION_NAME }}-x86_64.apk + - name: Commit and Push Changes + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add . + git commit -m "Release version ${{ env.VERSION_NAME }}" || echo "No changes to commit" + git config push.autoSetupRemote true + git push --set-upstream origin ${BRANCH_NAME} + - name: Create Draft Release id: create_draft_release uses: softprops/action-gh-release@v2 From ca7a88aa21bb4a5b94bf7eadbdfe18906f875c79 Mon Sep 17 00:00:00 2001 From: Anil Kumar Beesetti Date: Tue, 24 Dec 2024 10:08:25 +0530 Subject: [PATCH 4/4] set prerelease status and tag name --- .github/workflows/update_version_and_publish.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update_version_and_publish.yaml b/.github/workflows/update_version_and_publish.yaml index 1c2873f20..deb5f370f 100644 --- a/.github/workflows/update_version_and_publish.yaml +++ b/.github/workflows/update_version_and_publish.yaml @@ -147,3 +147,5 @@ jobs: draft: true name: v${{ env.VERSION_NAME }} generate_release_notes: true + prerelease: ${{ github.event.inputs.release_type == 'preview' }} + tag_name: v${{ env.VERSION_NAME }}