mucke/.github/workflows/main.yml
2022-12-29 20:48:04 +01:00

46 lines
1.7 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: Build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request, workflow_dispatch]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
env:
KEYSTORE_GITHUB: ${{ secrets.KEYSTORE_GITHUB }}
KEY_PROPERTIES_GITHUB: ${{ secrets.KEY_PROPERTIES_GITHUB }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
java-version: '12.x'
distribution: 'zulu'
- run: mkdir -p ../signing
- run: echo $KEYSTORE_GITHUB | base64 --decode > ../signing/github.jks
- run: echo $KEY_PROPERTIES_GITHUB > android/key.properties
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.3.3'
- run: flutter pub get
- run: flutter build apk --flavor github
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.0
with:
name: app-release.apk
path: src/build/app/outputs/flutter-apk/app-github-release.apk
- name: Github Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags')
with:
files: src/build/app/outputs/flutter-apk/app-github-release.apk