mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
Replace the reusable workflow with .github/actions/build plus a nested nix setup action, invoked as a step. CI and the next build stay a single job (no extra runner or Nix restore); the release keeps its build/publish split for credential isolation.
79 lines
2.4 KiB
YAML
79 lines
2.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-26.04
|
|
timeout-minutes: 60
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
version-code: ${{ steps.build.outputs.version-code }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
- id: build
|
|
uses: ./.github/actions/build
|
|
with:
|
|
gradle-args: ":app:assembleRelease :app:bundleRelease --no-daemon"
|
|
sign: "true"
|
|
keystore-base64: ${{ secrets.SUBTRACKS_KEYSTORE_BASE64 }}
|
|
keyproperties-base64: ${{ secrets.SUBTRACKS_KEYPROPERTIES_BASE64 }}
|
|
keystore-password: ${{ secrets.SUBTRACKS_UPLOAD_STORE_PASSWORD }}
|
|
key-password: ${{ secrets.SUBTRACKS_UPLOAD_KEY_PASSWORD }}
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: release
|
|
path: app/build/outputs
|
|
|
|
publish:
|
|
needs: build
|
|
runs-on: ubuntu-26.04
|
|
timeout-minutes: 60
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
name: release
|
|
path: dist
|
|
- uses: ./.github/actions/nix
|
|
- name: Upload to Google Play
|
|
env:
|
|
PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
|
|
run: |
|
|
umask 077
|
|
printf '%s' "$PLAY_SERVICE_ACCOUNT_JSON" > "$RUNNER_TEMP/play.json"
|
|
nix develop .#release --command fastlane supply \
|
|
--aab dist/bundle/release/app-release.aab \
|
|
--package_name com.subtracks \
|
|
--track "${{ vars.PLAY_TRACK || 'internal' }}" \
|
|
--release_status completed \
|
|
--json_key "$RUNNER_TEMP/play.json" \
|
|
--metadata_path metadata \
|
|
--mapping dist/mapping/release/mapping.txt
|
|
- name: Remove Play service account
|
|
if: always()
|
|
run: rm -f "$RUNNER_TEMP/play.json"
|
|
- name: Collect release APK
|
|
run: cp dist/apk/release/app-release.apk subtracks.apk
|
|
- name: Create GitHub release
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create "$GITHUB_REF_NAME" subtracks.apk \
|
|
--verify-tag \
|
|
--title "$GITHUB_REF_NAME" \
|
|
--notes-file "metadata/en-US/changelogs/${{ needs.build.outputs.version-code }}.txt"
|