release(desktop): Release v1.12.0 (#5060) #157
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 Orchestrator | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - mobile-main | |
| permissions: | |
| contents: write | |
| actions: write | |
| jobs: | |
| create_tag: | |
| name: Create Release Tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag_version: ${{ steps.release_info.outputs.tag_version }} | |
| platform: ${{ steps.release_info.outputs.platform }} | |
| version: ${{ steps.release_info.outputs.version }} | |
| ref_name: ${{ steps.release_info.outputs.ref_name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: lts/* | |
| - name: Make script executable | |
| run: | | |
| chmod +x .github/scripts/extract-release-info.mjs | |
| - name: Extract release information | |
| id: extract_info | |
| run: .github/scripts/extract-release-info.mjs | |
| continue-on-error: true | |
| - name: Expose release outputs | |
| id: release_info | |
| run: | | |
| echo "tag_version=${tag_version:-}" >> "$GITHUB_OUTPUT" | |
| echo "platform=${platform:-}" >> "$GITHUB_OUTPUT" | |
| echo "version=${version:-}" >> "$GITHUB_OUTPUT" | |
| echo "ref_name=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" | |
| - name: Validate git configuration | |
| if: steps.release_info.outputs.tag_version != '' | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Create and push tag | |
| if: steps.release_info.outputs.tag_version != '' | |
| run: | | |
| git fetch --tags --force | |
| echo "Creating tag: ${{ steps.release_info.outputs.tag_version }}" | |
| if git rev-parse "${{ steps.release_info.outputs.tag_version }}" >/dev/null 2>&1; then | |
| echo "Tag ${{ steps.release_info.outputs.tag_version }} already exists, skipping creation" | |
| exit 0 | |
| fi | |
| git tag "${{ steps.release_info.outputs.tag_version }}" | |
| git push origin "${{ steps.release_info.outputs.tag_version }}" | |
| echo "Successfully created and pushed tag: ${{ steps.release_info.outputs.tag_version }}" | |
| trigger_builds: | |
| name: Trigger Platform Builds | |
| needs: create_tag | |
| if: needs.create_tag.outputs.tag_version != '' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| if: needs.create_tag.outputs.platform == 'mobile' && needs.create_tag.outputs.ref_name == 'mobile-main' | |
| uses: actions/checkout@v7 | |
| - name: Resolve Mobile Release Config | |
| id: release_mode | |
| if: needs.create_tag.outputs.platform == 'mobile' && needs.create_tag.outputs.ref_name == 'mobile-main' | |
| env: | |
| RELEASE_VERSION: ${{ needs.create_tag.outputs.version }} | |
| RELEASE_CONFIG_PATH: apps/mobile/release.json | |
| run: node .github/scripts/resolve-mobile-release-config.mjs | |
| - name: Checkout repository | |
| if: needs.create_tag.outputs.platform == 'desktop' && needs.create_tag.outputs.ref_name == 'main' | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| if: needs.create_tag.outputs.platform == 'desktop' && needs.create_tag.outputs.ref_name == 'main' | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Resolve desktop build version | |
| if: needs.create_tag.outputs.platform == 'desktop' && needs.create_tag.outputs.ref_name == 'main' | |
| id: desktop_release_mode | |
| env: | |
| RELEASE_VERSION: ${{ needs.create_tag.outputs.version }} | |
| RELEASE_CONFIG_PATH: apps/desktop/release.json | |
| run: node .github/scripts/resolve-desktop-release-config.mjs | |
| - name: Resolve desktop build version | |
| id: desktop_build_version | |
| if: needs.create_tag.outputs.platform == 'desktop' && needs.create_tag.outputs.ref_name == 'main' && steps.desktop_release_mode.outputs.triggerStoreBuilds == 'true' | |
| run: | | |
| git fetch --tags --force | |
| latest_tag="$(git tag -l 'desktop-build/v*' --sort=-v:refname | head -n 1)" | |
| if [ -z "$latest_tag" ]; then | |
| last_build=110 | |
| else | |
| last_build="${latest_tag#desktop-build/v}" | |
| fi | |
| next_build=$((last_build + 1)) | |
| build_tag="desktop-build/v${next_build}" | |
| if git rev-parse "$build_tag" >/dev/null 2>&1; then | |
| echo "Build tag $build_tag already exists." | |
| exit 1 | |
| fi | |
| git tag "$build_tag" | |
| git push origin "$build_tag" | |
| echo "build_version=${next_build}" >> "$GITHUB_OUTPUT" | |
| echo "Desktop build version: ${next_build}" | |
| - name: Trigger Desktop Tag Version Build | |
| if: needs.create_tag.outputs.platform == 'desktop' && needs.create_tag.outputs.ref_name == 'main' && steps.desktop_release_mode.outputs.triggerDirectBuild == 'true' | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const response = await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'build-desktop.yml', | |
| ref: 'main', | |
| inputs: { | |
| tag_version: 'true', | |
| store: 'false' | |
| } | |
| }); | |
| console.log('Desktop Tag Version build triggered successfully'); | |
| - name: Trigger Desktop Store Build | |
| if: needs.create_tag.outputs.platform == 'desktop' && needs.create_tag.outputs.ref_name == 'main' && steps.desktop_release_mode.outputs.triggerStoreBuilds == 'true' | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const response = await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'build-desktop.yml', | |
| ref: 'main', | |
| inputs: { | |
| tag_version: 'false', | |
| store: 'true', | |
| build_version: '${{ steps.desktop_build_version.outputs.build_version }}' | |
| } | |
| }); | |
| console.log('Desktop store build triggered successfully'); | |
| - name: Trigger Mobile Production APK Release Build | |
| if: needs.create_tag.outputs.platform == 'mobile' && needs.create_tag.outputs.ref_name == 'mobile-main' && steps.release_mode.outputs.trigger_release_apk == 'true' | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const response = await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'build-android.yml', | |
| ref: 'mobile-main', | |
| inputs: { | |
| profile: 'production-apk', | |
| release: 'true' | |
| } | |
| }); | |
| console.log('Mobile production APK release build triggered successfully'); | |
| - name: Trigger Mobile Production Android Build | |
| if: needs.create_tag.outputs.platform == 'mobile' && needs.create_tag.outputs.ref_name == 'mobile-main' && steps.release_mode.outputs.trigger_store_builds == 'true' | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const response = await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'build-android.yml', | |
| ref: 'mobile-main', | |
| inputs: { | |
| profile: 'production', | |
| release: 'false' | |
| } | |
| }); | |
| console.log('Mobile production Android build triggered successfully'); | |
| - name: Trigger Mobile Production iOS Build | |
| if: needs.create_tag.outputs.platform == 'mobile' && needs.create_tag.outputs.ref_name == 'mobile-main' && steps.release_mode.outputs.trigger_store_builds == 'true' | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const response = await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'build-ios.yml', | |
| ref: 'mobile-main', | |
| inputs: { | |
| profile: 'production' | |
| } | |
| }); | |
| console.log('Mobile production iOS build triggered successfully'); | |
| - name: Trigger Mobile OTA Publish | |
| if: needs.create_tag.outputs.platform == 'mobile' && needs.create_tag.outputs.ref_name == 'mobile-main' && steps.release_mode.outputs.trigger_ota_publish == 'true' | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'publish-ota.yml', | |
| ref: '${{ needs.create_tag.outputs.tag_version }}', | |
| inputs: { | |
| release_version: '${{ steps.release_mode.outputs.release_version }}', | |
| runtime_version: '${{ steps.release_mode.outputs.runtime_version }}', | |
| channel: '${{ steps.release_mode.outputs.channel }}' | |
| } | |
| }); | |
| console.log('Mobile OTA publish workflow triggered successfully'); |