refactor(ci): separate release and promotion workflows (#3339)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-10-04 16:08:55 -05:00 committed by GitHub
parent be518bb60b
commit 7d827dc9f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 125 additions and 129 deletions

View file

@ -3,6 +3,10 @@ name: Make Release
on:
workflow_call:
inputs:
base_version:
description: 'The base version for the release (e.g., 2.3.0)'
required: true
type: string
tag_name:
description: 'The tag that triggered the release'
required: true
@ -55,13 +59,11 @@ jobs:
fetch-depth: 0
submodules: 'recursive'
- name: Set up JDK 21
if: ${{ inputs.channel == 'internal' }}
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'jetbrains'
- name: Setup Gradle
if: ${{ inputs.channel == 'internal' }}
uses: gradle/actions/setup-gradle@v5
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
@ -100,13 +102,11 @@ jobs:
fetch-depth: 0
submodules: 'recursive'
- name: Set up JDK 21
if: ${{ inputs.channel == 'internal' }}
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'jetbrains'
- name: Setup Gradle
if: ${{ inputs.channel == 'internal' }}
uses: gradle/actions/setup-gradle@v5
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
@ -140,27 +140,13 @@ jobs:
ruby-version: '3.2'
bundler-cache: true
- name: Determine Fastlane Lane
id: fastlane_lane
run: |
if [[ "${{ inputs.tag_name }}" == *"-internal"* ]]; then
echo "lane=internal" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.tag_name }}" == *"-closed"* ]]; then
echo "lane=closed" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.tag_name }}" == *"-open"* ]]; then
echo "lane=open" >> $GITHUB_OUTPUT
else
echo "lane=production" >> $GITHUB_OUTPUT
fi
- name: Build and Deploy Google Play Tracks with Fastlane
- name: Build and Deploy Google Play to Internal Track with Fastlane
env:
VERSION_NAME: ${{ needs.prepare-build-info.outputs.APP_VERSION_NAME }}
VERSION_CODE: ${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }}
run: bundle exec fastlane ${{ steps.fastlane_lane.outputs.lane }}
run: bundle exec fastlane internal
- name: Upload Google AAB artifact
if: ${{ inputs.channel == 'internal' }}
uses: actions/upload-artifact@v4
with:
name: google-aab
@ -168,7 +154,6 @@ jobs:
retention-days: 1
- name: Upload Google APK artifact
if: ${{ inputs.channel == 'internal' }}
uses: actions/upload-artifact@v4
with:
name: google-apk
@ -176,7 +161,6 @@ jobs:
retention-days: 1
- name: Attest Google artifacts provenance
if: ${{ inputs.channel == 'internal' }}
uses: actions/attest-build-provenance@v3
with:
subject-path: |
@ -188,29 +172,18 @@ jobs:
needs: prepare-build-info
environment: Release
steps:
- name: Check if build is required
id: check_build
run: |
if [[ "${{ inputs.channel }}" == "internal" ]]; then
echo "should_build=true" >> $GITHUB_OUTPUT
else
echo "should_build=false" >> $GITHUB_OUTPUT
fi
- name: Checkout code
if: steps.check_build.outputs.should_build == 'true'
uses: actions/checkout@v5
with:
ref: ${{ inputs.tag_name }}
fetch-depth: 0
submodules: 'recursive'
- name: Set up JDK 21
if: steps.check_build.outputs.should_build == 'true'
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'jetbrains'
- name: Setup Gradle
if: steps.check_build.outputs.should_build == 'true'
uses: gradle/actions/setup-gradle@v5
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
@ -219,7 +192,6 @@ jobs:
build-scan-terms-of-use-agree: 'yes'
- name: Load secrets
if: steps.check_build.outputs.should_build == 'true'
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
KEYSTORE_FILENAME: ${{ secrets.KEYSTORE_FILENAME }}
@ -229,21 +201,18 @@ jobs:
echo "$KEYSTORE_PROPERTIES" > ./keystore.properties
- name: Setup Fastlane
if: steps.check_build.outputs.should_build == 'true'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Build F-Droid with Fastlane
if: steps.check_build.outputs.should_build == 'true'
env:
VERSION_NAME: ${{ needs.prepare-build-info.outputs.APP_VERSION_NAME }}
VERSION_CODE: ${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }}
run: bundle exec fastlane fdroid_build
- name: Upload F-Droid APK artifact
if: steps.check_build.outputs.should_build == 'true'
uses: actions/upload-artifact@v4
with:
name: fdroid-apk
@ -251,7 +220,6 @@ jobs:
retention-days: 1
- name: Attest F-Droid APK provenance
if: steps.check_build.outputs.should_build == 'true'
uses: actions/attest-build-provenance@v3
with:
subject-path: app/build/outputs/apk/fdroid/release/app-fdroid-release.apk
@ -265,29 +233,12 @@ jobs:
with:
path: ./artifacts
- name: Determine Release Properties
id: release_properties
run: |
if [[ "${{ inputs.channel }}" == "internal" ]]; then
echo "draft=true" >> $GITHUB_OUTPUT
echo "prerelease=true" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.channel }}" == "closed" ]]; then
echo "draft=false" >> $GITHUB_OUTPUT
echo "prerelease=true" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.channel }}" == "open" ]]; then
echo "draft=false" >> $GITHUB_OUTPUT
echo "prerelease=true" >> $GITHUB_OUTPUT
else
echo "draft=false" >> $GITHUB_OUTPUT
echo "prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Create or Update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag_name }}
tag_name: ${{ inputs.base_version }}
name: ${{ inputs.tag_name }}
generate_release_notes: true
files: ./artifacts/*/*
draft: ${{ steps.release_properties.outputs.draft }}
prerelease: ${{ steps.release_properties.outputs.prerelease }}
draft: true
prerelease: true