changelog for fdroid #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Build | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
env: | |
APK_BUILD_DIR: "/tmp/build" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Setup Java to compile Android project | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Get version from pubspec.yaml | |
id: get_version | |
run: | | |
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' pubspec.yaml) | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Copy files to env.APK_BUILD_DIR | |
run: | | |
mkdir -p $APK_BUILD_DIR | |
cp -r . $APK_BUILD_DIR | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Flutter version | |
run: | | |
flutter config --no-analytics | |
flutter --version | |
- name: Decode key.properties file | |
working-directory: ${{ env.APK_BUILD_DIR }} | |
env: | |
ENCODED_STRING: ${{ secrets.ANDROID_KEY_PROPERTIES }} | |
run: echo $ENCODED_STRING | base64 -di > android/key.properties | |
- name: Decode android-keystore.jks file | |
working-directory: ${{ env.APK_BUILD_DIR }} | |
env: | |
ENCODED_STRING: ${{ secrets.KEY_JKS }} | |
run: echo $ENCODED_STRING | base64 -di > android/key.jks | |
- name: Dependencies | |
working-directory: ${{ env.APK_BUILD_DIR }} | |
run: flutter pub get | |
- name: Build generated files | |
working-directory: ${{ env.APK_BUILD_DIR }} | |
run: flutter pub run build_runner build -d | |
- name: Build APK | |
working-directory: ${{ env.APK_BUILD_DIR }} | |
run: flutter build apk --release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-apk | |
path: ${{ env.APK_BUILD_DIR }}/build/app/outputs/flutter-apk/app-release.apk | |