Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/prepare-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Prepare Release PR

on:
workflow_call:
inputs:
abi_apks:
description: "Reserve version codes and changelogs for per-ABI APKs"
required: false
type: boolean
default: false

concurrency:
group: release-pr-${{ github.repository }}
Expand Down Expand Up @@ -31,9 +37,15 @@ jobs:

- name: Get next version code
id: version-code
env:
ABI_APKS: ${{ inputs.abi_apks }}
run: |
currentVersionCode=$(grep '^VERSION_CODE=' gradle.properties | cut -d= -f2)
nextVersionCode=$((currentVersionCode+1))
if [[ "$ABI_APKS" == "true" ]]; then
nextVersionCode=$(( (currentVersionCode / 10 + 1) * 10 ))
else
nextVersionCode=$((currentVersionCode+1))
fi
echo "nextVersionCode=$nextVersionCode" >> $GITHUB_OUTPUT

- name: Check release history
Expand Down Expand Up @@ -170,6 +182,8 @@ jobs:
if: ${{ steps.update-version.outcome == 'success' }}
id: extract_changelog
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
env:
ABI_APKS: ${{ inputs.abi_apks }}
with:
script: |
const fs = require('fs');
Expand All @@ -184,12 +198,15 @@ jobs:

try {
const fastlaneNotes = formatForFastlane(changelogPath, tagVersion);
const versionCode = "${{ steps.version-code.outputs.nextVersionCode }}";
const versionCode = Number("${{ steps.version-code.outputs.nextVersionCode }}");
const metadataPath = path.join(process.env.GITHUB_WORKSPACE, 'fastlane', 'metadata', 'android', 'en-US', 'changelogs');
if (!fs.existsSync(metadataPath)) {
fs.mkdirSync(metadataPath, { recursive: true });
}
fs.writeFileSync(path.join(metadataPath, `${versionCode}.txt`), fastlaneNotes);
const offsets = process.env.ABI_APKS === 'true' ? [0, 1, 2, 3, 4] : [0];
for (const offset of offsets) {
fs.writeFileSync(path.join(metadataPath, `${versionCode + offset}.txt`), fastlaneNotes);
}

// Use GitHub format for the PR body
const notes = formatForGitHub(changelogPath, tagVersion, null, process.env.GITHUB_REPOSITORY);
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Release
on:
workflow_call:
inputs:
abi_apks:
description: "Publish universal and per-ABI FOSS APKs"
required: false
type: boolean
default: false
track:
description: "Rollout track (e.g. beta, production)"
required: false
Expand Down Expand Up @@ -152,7 +157,14 @@ jobs:
java-version: "17"

- name: Build Release APK
run: ./gradlew assembleFossRelease
env:
ABI_APKS: ${{ inputs.abi_apks }}
run: |
if [[ "$ABI_APKS" == "true" ]]; then
./gradlew assembleFossRelease -PABI_SPLITS=true
else
./gradlew assembleFossRelease
fi

- name: Setup NodeJS
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
Expand Down
Loading