release v4.7.0 #33
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
# Drafts a GitHub release with the APK attached. | |
name: Draft GitHub release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v*.*.* | |
jobs: | |
android: | |
name: Draft release and attach APK | |
runs-on: ubuntu-latest | |
environment: release-android | |
env: | |
UPLOAD_KEYSTORE: ${{ secrets.UPLOAD_KEYSTORE }} | |
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEY_FILE_PATH: android/key.properties | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
SECRET: ${{ secrets.SECRET }} | |
steps: | |
- name: Checkout Frosty repo | |
uses: actions/checkout@v4 | |
# Setup Java so that we can build the APK. | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
# Setup and cache Flutter to install packages and build. | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
# Decode and create the upload-keystore.jks file, used for signing the app. | |
- name: Decode and create upload-keystore.jks | |
run: echo $UPLOAD_KEYSTORE | base64 --decode > $GITHUB_WORKSPACE/android/upload-keystore.jks | |
# Create the key.properties file, used for signing the app. | |
- name: Create key.properties | |
run: | | |
echo storePassword=$STORE_PASSWORD >> $KEY_FILE_PATH | |
echo keyPassword=$KEY_PASSWORD >> $KEY_FILE_PATH | |
echo keyAlias=upload >> $KEY_FILE_PATH | |
echo storeFile=$GITHUB_WORKSPACE/android/upload-keystore.jks >> $KEY_FILE_PATH | |
# Build the APK with the environment variables and move/rename it. | |
- name: Build for Android | |
run: | | |
flutter build apk --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET | |
mv build/app/outputs/flutter-apk/app-release.apk frosty-${{ github.ref_name }}.apk | |
# Create a draft release on GitHub. | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
generate_release_notes: true | |
files: frosty-${{ github.ref_name }}.apk |