ci: add signed release workflow and fastlane metadata
Some checks failed
Release APK / build (push) Failing after 14s
Some checks failed
Release APK / build (push) Failing after 14s
Adds a Forgejo Actions workflow that builds a release APK on tag push, reading signing credentials from repo secrets with a debug-key fallback for local builds, and publishes the APK plus fastlane changelog to a Forgejo release.
This commit is contained in:
parent
2b6976ca72
commit
68e3c529cb
8 changed files with 84 additions and 3 deletions
57
.forgejo/workflows/release.yml
Normal file
57
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
name: Release APK
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: linux-x86_64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version
|
||||
run: |
|
||||
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
|
||||
echo "VERSION_CODE=$(echo "$VERSION" | grep -oP '(?<=\+)\d+')" >> $GITHUB_ENV
|
||||
echo "VERSION_NAME=$(echo "$VERSION" | grep -oP '^[^+]+')" >> $GITHUB_ENV
|
||||
|
||||
- name: Decode keystore
|
||||
run: |
|
||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/release.jks
|
||||
echo "KEYSTORE_PATH=$GITHUB_WORKSPACE/android/app/release.jks" >> $GITHUB_ENV
|
||||
|
||||
- name: Build release APK
|
||||
env:
|
||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||
run: |
|
||||
env -u GITHUB_TOKEN -u GH_TOKEN -u JAVA_HOME \
|
||||
devbox run -- flutter build apk --release
|
||||
|
||||
- name: Create release and upload APK
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
APK="plasmoid-${{ env.VERSION_NAME }}.apk"
|
||||
cp build/app/outputs/flutter-apk/app-release.apk "$APK"
|
||||
|
||||
BODY=$(python3 -c "
|
||||
import json
|
||||
print(json.dumps(open('fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt').read().strip()))
|
||||
")
|
||||
|
||||
RELEASE_ID=$(curl -sf -X POST \
|
||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases" \
|
||||
-d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\",\"body\":$BODY}" \
|
||||
| python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||
-H "Content-Type: application/vnd.android.package-archive" \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=$APK" \
|
||||
--data-binary @"$APK"
|
||||
Loading…
Add table
Add a link
Reference in a new issue