Skip to content

Update: v8.7.1

Update: v8.7.1 #1268

Workflow file for this run

on:
push:
branches:
- master
name: Test, Build and Release apk
env:
PROPERTIES_PATH: './android/key.properties'
jobs:
build:
name: Build APK
if: "contains(github.event.head_commit.message, 'Update:')"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Extract version from commit message
- name: Extract version
id: extract_version
run: |
version=$(echo ${{ github.event.head_commit.message }} | grep -oP '(?<=Update: v)\d+\.\d+\.\d+')
echo "version=${version}" >> $GITHUB_OUTPUT
# Setup Java environment in order to build the Android app.
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17.x'
# Gradle cache for faster builds
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
# Setup the Flutter environment.
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
#
- run: |
echo keyPassword=\${{ secrets.KEY_STORE }} > ${{env.PROPERTIES_PATH}}
echo storePassword=\${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}}
#
- run: echo "${{ secrets.KEYSTORE2 }}" | base64 --decode > android/app/key.jks
# Get Flutter dependencies.
- name: Get Flutter dependencies
run: flutter pub get
# Check for any formatting issues in the code.
- name: Check code formatting
run: dart format --set-exit-if-changed .
# Statically analyze the Dart code for any errors.
- name: Analyze Dart code
run: flutter analyze .
# Build arm64 APK for GitHub release
- name: Build arm64 APK
run: flutter build apk --release --split-per-abi --target-platform="android-arm64" --flavor github
# Release arm64 generated APK
- name: Release arm64 APK
uses: svenstaro/upload-release-action@v2
with:
repo_name: gokadzev/Musify
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/app/outputs/flutter-apk/app-arm64-v8a-github-release.apk
asset_name: Musify-arm64-v8a.apk
tag: ${{ steps.extract_version.outputs.version }}
prerelease: false
overwrite: true
# Build universal APK
- name: Build universal APK
run: flutter build apk --release --flavor github
# Release universal generated APK
- name: Release universal APK
uses: svenstaro/upload-release-action@v2
with:
repo_name: gokadzev/Musify
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/app/outputs/flutter-apk/app-github-release.apk
asset_name: Musify.apk
tag: ${{ steps.extract_version.outputs.version }}
prerelease: false
overwrite: true