worldhopper/.forgejo/workflows/release.yml
Felipe M. 1b6d35b16d
Some checks failed
PR / lint (pull_request) Failing after 0s
chore: pin ci-base image to 1.0.0
2026-04-07 12:39:51 +02:00

69 lines
2.2 KiB
YAML

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: docker
container:
image: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Install Flutter
uses: actions/flutter-action@v2
with:
channel: stable
- name: Set up release signing
env:
SIGNING_KEYSTORE: ${{ secrets.SIGNING_KEYSTORE }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: |
echo "$SIGNING_KEYSTORE" | base64 -d > android/app/upload-keystore.jks
cat > android/key.properties << EOF
storePassword=$SIGNING_STORE_PASSWORD
keyPassword=$SIGNING_KEY_PASSWORD
keyAlias=$SIGNING_KEY_ALIAS
storeFile=upload-keystore.jks
EOF
- name: Build APK
run: |
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
VERSION_NAME=$(sh scripts/version.sh | head -1)
VERSION_CODE=$(sh scripts/version.sh | tail -1)
echo "Building version ${VERSION_NAME} (code ${VERSION_CODE})"
flutter build apk --release --build-name="$VERSION_NAME" --build-number="$VERSION_CODE"
cp build/app/outputs/flutter-apk/app-release.apk worldhopper-${{ github.ref_name }}.apk
- name: Generate changelog
run: |
bash scripts/generate-changelog.sh "${{ github.ref_name }}" CHANGELOG.md
env:
CI_FORGE_URL: ${{ github.server_url }}
CI_REPO: ${{ github.repository }}
- name: Prepare release assets
run: |
mkdir -p dist/release
cp worldhopper-${{ github.ref_name }}.apk dist/release/
- name: Create release
uses: actions/forgejo-release@v2
with:
direction: upload
token: ${{ secrets.FORGEJO_TOKEN }}
tag: ${{ github.ref_name }}
release-dir: dist/release
release-notes-file: CHANGELOG.md
prerelease: ${{ contains(github.ref_name, '-rc.') }}