fix: add workflow under .forgejo/workflows/ (Forgejo preferred path)
Some checks failed
Release APK / build (push) Failing after 5s
Some checks failed
Release APK / build (push) Failing after 5s
This commit is contained in:
parent
82b060ad30
commit
1508b6e76a
1 changed files with 55 additions and 0 deletions
55
.forgejo/workflows/release.yml
Normal file
55
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
name: Release APK
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: linux-x86_64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: "stable"
|
||||
cache: true
|
||||
|
||||
- name: Extract version code from pubspec
|
||||
run: |
|
||||
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
|
||||
VERSION_CODE=$(echo "$VERSION" | grep -oP '(?<=\+)\d+')
|
||||
VERSION_NAME=$(echo "$VERSION" | grep -oP '^[^+]+')
|
||||
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
|
||||
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
|
||||
|
||||
- name: Decode keystore
|
||||
run: |
|
||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/kirakira-release.jks
|
||||
echo "KEYSTORE_PATH=$GITHUB_WORKSPACE/android/app/kirakira-release.jks" >> $GITHUB_ENV
|
||||
|
||||
- name: Build release APK (prod flavor)
|
||||
env:
|
||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||
run: flutter build apk --release --flavor prod
|
||||
|
||||
- name: Rename APK
|
||||
run: |
|
||||
cp build/app/outputs/flutter-apk/app-prod-release.apk \
|
||||
"kirakira-${{ env.VERSION_NAME }}.apk"
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: kirakira-*.apk
|
||||
body_path: fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue