Merge pull request #3 from RedCommander735/daterange-filter #47
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
name: Build | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Decrypt | |
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.KEYPASSWORD }}" --output ./android/app/keystore/upload-keystore.jks ./android/app/keystore/upload-keystore.jks.gpg | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: "12.x" | |
cache: 'gradle' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version-file: 'pubspec.yaml' | |
channel: 'stable' | |
cache: true | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Start release build | |
if: github.ref_name == 'main' | |
run: flutter build apk | |
env: | |
storePassword: ${{ secrets.STOREPASSWORD }} | |
keyPassword: ${{ secrets.KEYPASSWORD }} | |
keyAlias: 'upload' | |
storeFile: './keystore/upload-keystore.jks' | |
- name: Start debug build | |
if: github.ref_name != 'main' | |
run: flutter build apk --debug | |
env: | |
storePassword: ${{ secrets.STOREPASSWORD }} | |
keyPassword: ${{ secrets.KEYPASSWORD }} | |
keyAlias: 'upload' | |
storeFile: './keystore/upload-keystore.jks' | |
- name: Archive build artefact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: build/app/outputs/flutter-apk/*.apk | |
- name: Rename apk | |
if: startsWith(github.ref, 'refs/tags/') | |
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/${{ github.ref_name }}-release.apk | |
- name: Save changelog | |
if: startsWith(github.ref, 'refs/tags/') | |
run: cp 'changelogs/CHANGELOG - latest.md' 'changelogs/CHANGELOG - ${{ github.ref_name }}.md' | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body_path: 'changelogs/CHANGELOG - ${{ github.ref_name }}.md' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: build/app/outputs/flutter-apk/${{ github.ref_name }}-release.apk |