Skip to content

Commit

Permalink
optimization build when commit upversion
Browse files Browse the repository at this point in the history
  • Loading branch information
any116xxxx committed Dec 29, 2024
1 parent c0fed0b commit ddc2ec8
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,22 @@ jobs:
name: x86-apk
path: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/*/release/*x86*.apk

- name: Setup release tag
if: startsWith(github.event.head_commit.message, 'up ') || github.event.inputs.release_tag != ''
run: |
if [[ -n "${{ github.event.inputs.release_tag }}" ]]; then
TAG="${{ github.event.inputs.release_tag }}"
elif [[ "${{ github.event.head_commit.message }}" =~ ^up\ [0-9.]+$ ]]; then
TAG=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'up \K[0-9.]+')
fi
VER=$(grep 'versionName =' ${{ github.workspace }}/V2rayNG/app/build.gradle.kts | sed 's/.*versionName = "\(.*\)"/\1/')
[[ "$VER" != "$TAG" ]] && exit 1
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Upload to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
uses: softprops/action-gh-release@v2
if: ${{ env.TAG != '' }}
with:
file: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/*playstore*/release/*.apk
tag: ${{ github.event.inputs.release_tag }}
file_glob: true
files: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/*playstore*/release/*apk
tag_name: ${{ env.TAG }}
prerelease: true

0 comments on commit ddc2ec8

Please sign in to comment.