fix: updated #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Release Build" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Node modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
key: npm-${{ hashFiles('package-lock.json') }} | |
- name: Setup semantic-release | |
run: npm install | |
- name: Bump version code | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release --extends ./.releaserc.bump.json --no-ci --dry-run | |
- name: Set env | |
run: echo "RELEASE_VERSION=$(cat .VERSION)" >> $GITHUB_ENV | |
- name: Bump pubspec version | |
run: | | |
IFS='.' read -r -a nums <<< "${RELEASE_VERSION/-dev/}.0" | |
VERSIONCODE=$((nums[0] * 100000000 + nums[1] * 100000 + nums[2] * 100 + nums[3])) | |
sed -i "/^version/c\\version: ${{ env.RELEASE_VERSION }}+$VERSIONCODE" pubspec.yaml | |
- name: Rename APK | |
run: mv build/app/outputs/apk/release/app-release.apk revanced-manager-v${{ env.RELEASE_VERSION }}.apk | |
- name: Publish release APK | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release --extends ./.releaserc.release.json |