Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Fix issue with github actions #1185

Merged
merged 4 commits into from
Dec 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/update_version_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 --all

if git rev-parse --verify origin/${BRANCH_NAME} >/dev/null 2>&1; then
echo "Branch ${BRANCH_NAME} exists, checking out..."
Expand All @@ -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
Expand Down Expand Up @@ -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 "[email protected]"
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:
Expand Down Expand Up @@ -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 "[email protected]"
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
Expand All @@ -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 }}
Loading