Skip to content

Build Installer

Build Installer #1

Workflow file for this run

name: Build Installer
on:
workflow_dispatch:
inputs:
version:
required: true
description: The version of this release. Should be lower than the last and in the format 1.0.0
default: "1.0.0"
title:
required: true
description: Title of this release
description:
required: false
description: Description of this release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
path: src
- name: Setup Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2.10.0
with:
flutter-version: '3.10.6'
- name: Build Installer
run: |
cd $GITHUB_WORKSPACE/src/installer
echo "${{ secrets.keystore }}" | base64 -d > ../../keystore.jks
echo "storePassword: ${{ secrets.keystorePassword }}" > android/key.properties
echo "keyPassword: ${{ secrets.keyPassword }}" >> android/key.properties
echo "keyAlias: Installer" >> android/key.properties
echo "storeFile: ../../../../keystore.jks" >> android/key.properties
versionName="${{ github.event.inputs.version }}"
versionCode="${versionName//./}"
flutter build apk --build-number "$versionCode" --build-name "$versionName"
mv build/app/outputs/flutter-apk/app-release.apk ../../Installer-release.apk
rm ../../keystore.jks
rm android/key.properties
- name: Release
run: |
cd $GITHUB_WORKSPACE/src
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
tag="${{ github.event.inputs.version }}"
git tag "$tag"
git push origin "$tag"
gh release create "$tag" \
--title "${{ github.event.inputs.title }}" \
--notes "${{ github.event.inputs.description }}" \
../Installer-release.apk
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'