chore: bump version to 2.48.4 #664
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_behavior: | |
| description: "If publish_release, will create a release and publish it to the release branch. If push_beta, will create a beta build and push it to the beta track." | |
| required: true | |
| default: "publish_release" | |
| type: choice | |
| options: | |
| - publish_release | |
| - push_beta | |
| push: | |
| branches: | |
| - "main" | |
| env: | |
| APP_BUILD_OFFSET: 300 | |
| jobs: | |
| app_build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: calculate | |
| run: | | |
| APP_BUILD=$((${{ github.run_number }} + $APP_BUILD_OFFSET)) | |
| echo "app_build=$APP_BUILD" >> $GITHUB_OUTPUT | |
| echo "App build number: \`$APP_BUILD\`" >> $GITHUB_STEP_SUMMARY | |
| outputs: | |
| app_build: ${{ steps.calculate.outputs.app_build }} | |
| app_version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| app_version: ${{ steps.app_version.outputs.app_version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| - name: Get current version from package.json | |
| id: app_version | |
| run: | | |
| APP_VERSION=$(node -p "require('./package.json').version") | |
| echo "app_version=$APP_VERSION" >> $GITHUB_OUTPUT | |
| echo "current app version: $APP_VERSION" | |
| - name: Verify provided version not already released | |
| if: inputs.release_behavior == 'publish_release' | |
| run: | | |
| git fetch --tags | |
| TAG_NAME="${{ steps.app_version.outputs.app_version }}" | |
| if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then | |
| echo "Error: Tag $TAG_NAME already exists" | |
| exit 1 | |
| fi | |
| bump_src: | |
| needs: [app_build, app_version] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| cache: pnpm | |
| - name: 📦 Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run trapeze (update iOS and Android version/code) | |
| run: pnpm trapeze run trapeze.yaml -y | |
| env: | |
| APP_BUILD: ${{ needs.app_build.outputs.app_build }} | |
| APP_VERSION: ${{ needs.app_version.outputs.app_version }} | |
| - name: Add build metadata | |
| run: | | |
| echo """APP_VERSION=${{ needs.app_version.outputs.app_version }} | |
| APP_BUILD=${{ needs.app_build.outputs.app_build }} | |
| APP_GIT_REF=${{ inputs.release_behavior != 'publish_release' && github.sha || needs.app_version.outputs.app_version }}""" > .env | |
| echo "wrote .env:" | |
| cat .env | |
| # Committed into the release tag (like .env) so the flathub repo can | |
| # copy exact per-release offline sources. PR CI regenerates these on | |
| # the fly instead (see flatpak.yml) | |
| - name: Generate flatpak offline sources | |
| run: bash flatpak/generate-sources.sh | |
| - name: Determine changed files | |
| id: determine_changes | |
| run: | | |
| git add . | |
| echo "will upload the following files:" | |
| git --no-pager diff HEAD --name-only | |
| echo "all modifications:" | |
| git --no-pager diff HEAD | |
| echo 'files<<EOF' >> $GITHUB_OUTPUT | |
| git --no-pager diff HEAD --name-only >> $GITHUB_OUTPUT | |
| echo EOF >> $GITHUB_OUTPUT | |
| - name: Upload bumped version artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: release-data | |
| path: ${{ steps.determine_changes.outputs.files }} | |
| include-hidden-files: true # needed for .env | |
| dispatch_beta_release: | |
| if: inputs.release_behavior != 'publish_release' | |
| needs: [bump_src] | |
| uses: ./.github/workflows/build_release.yml | |
| with: | |
| is_main_build: true | |
| secrets: inherit | |
| permissions: | |
| contents: write # needed for create_release, even though it won't be called | |
| packages: write # docker release | |
| id-token: write # aws + attestation | |
| attestations: write | |
| push_release: | |
| needs: [bump_src, app_build, app_version] | |
| runs-on: ubuntu-latest | |
| if: inputs.release_behavior == 'publish_release' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false # Don't clobber the PAT below | |
| fetch-depth: 0 # tags + history for metainfo release notes | |
| - name: Download bumped version artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: release-data | |
| - name: Generate metainfo release entry | |
| run: scripts/generate_metainfo_release.sh "${{ needs.app_version.outputs.app_version }}" | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_tag_gpgsign: true | |
| - name: Commit and push release | |
| env: | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| # Github doesn't trigger subsequent workflows unless push with a PAT | |
| run: | | |
| git remote set-url origin "https://${PAT_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
| git config --global user.email "voyager.ci.noreply@harding.dev" | |
| git config --global user.name "Voyager CI" | |
| git add . | |
| git commit -S -m "release: ${{ needs.app_version.outputs.app_version }} (${{ needs.app_build.outputs.app_build }})" | |
| TAG_NAME="${{ needs.app_version.outputs.app_version }}" | |
| echo "Creating tag: $TAG_NAME" | |
| git tag -s "$TAG_NAME" -m "release: ${{ needs.app_version.outputs.app_version }} (${{ needs.app_build.outputs.app_build }})" | |
| git push origin "$TAG_NAME" | |
| flathub_update: | |
| needs: [push_release, app_version] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ needs.app_version.outputs.app_version }} | |
| # PAT_TOKEN must have write access to flathub/app.vger.voyager | |
| - name: Open flathub update PR | |
| env: | |
| GH_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| VERSION: ${{ needs.app_version.outputs.app_version }} | |
| run: | | |
| COMMIT=$(git rev-parse HEAD) | |
| git clone --depth 1 "https://${GH_TOKEN}@github.com/flathub/app.vger.voyager.git" flathub | |
| cp flatpak/app.vger.voyager.yml flatpak/node-sources.json flatpak/cargo-sources.json flatpak/pnpm-sources.json flathub/ | |
| sed -i \ | |
| -e "s|^ tag: .*| tag: ${VERSION}|" \ | |
| -e "s|^ commit: .*| commit: ${COMMIT}|" \ | |
| flathub/app.vger.voyager.yml | |
| grep -q "^ tag: ${VERSION}$" flathub/app.vger.voyager.yml | |
| grep -q "^ commit: ${COMMIT}$" flathub/app.vger.voyager.yml | |
| cd flathub | |
| git config user.email "voyager.ci.noreply@harding.dev" | |
| git config user.name "Voyager CI" | |
| git checkout -b "update-to-${VERSION}" | |
| git add . | |
| if git diff --cached --quiet; then | |
| echo "flathub already up to date" | |
| exit 0 | |
| fi | |
| git commit -m "Update to ${VERSION}" | |
| git push --force origin "update-to-${VERSION}" | |
| if [ "$(gh pr list --repo flathub/app.vger.voyager --head "update-to-${VERSION}" --json number --jq length)" = "0" ]; then | |
| gh pr create --repo flathub/app.vger.voyager --head "update-to-${VERSION}" --base master --title "Update to ${VERSION}" --body "" | |
| fi |