mucke/.github/workflows/main.yml

46 lines
1.6 KiB
YAML
Raw Normal View History

2020-06-01 22:26:17 +02:00
# This is a basic workflow to help you get started with Actions
2020-06-07 11:39:37 +02:00
name: Build
2020-06-01 22:26:17 +02:00
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
2022-10-03 14:15:12 +02:00
on: [push, pull_request, workflow_dispatch]
2020-06-01 22:26:17 +02:00
# 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"
2020-06-07 11:39:37 +02:00
build:
2020-06-01 22:26:17 +02:00
# The type of runner that the job will run on
runs-on: ubuntu-latest
2022-10-02 22:32:12 +02:00
defaults:
run:
working-directory: src
2022-12-29 20:43:22 +01:00
env:
KEYSTORE_GITHUB: ${{ secrets.KEYSTORE_GITHUB }}
KEY_PROPERTIES_GITHUB: ${{ secrets.KEY_PROPERTIES_GITHUB }}
2020-06-01 22:26:17 +02:00
# 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
2022-10-02 22:13:22 +02:00
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
2020-06-01 22:26:17 +02:00
with:
java-version: '12.x'
2022-10-02 22:27:17 +02:00
distribution: 'zulu'
2022-12-29 21:00:01 +01:00
- run: echo $KEYSTORE_GITHUB | base64 --decode > android/github.jks
2022-12-29 20:43:22 +01:00
- run: echo $KEY_PROPERTIES_GITHUB > android/key.properties
2022-10-02 22:13:22 +02:00
- uses: subosito/flutter-action@v2
2020-06-01 22:26:17 +02:00
with:
2022-10-02 22:32:12 +02:00
flutter-version: '3.3.3'
2020-06-01 22:26:17 +02:00
- run: flutter pub get
2022-12-29 20:43:22 +01:00
- run: flutter build apk --flavor github
2022-10-08 21:47:44 +02:00
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.0
with:
name: app-release.apk
2022-12-29 20:43:22 +01:00
path: src/build/app/outputs/flutter-apk/app-github-release.apk
- name: Github Release
uses: softprops/action-gh-release@v1
2022-10-03 14:26:55 +02:00
if: startsWith(github.ref, 'refs/tags')
with:
2022-12-29 20:43:22 +01:00
files: src/build/app/outputs/flutter-apk/app-github-release.apk