ah shit 😬😬 #21
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
# Run all main Flutter style and test checks | |
name: Build and publish new release on version tag | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
env: | |
flutter_channel: "any" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Clean tag name | |
id: clean_tag | |
run: echo "::set-output name=tag::$(echo ${{ github.ref }} | sed 's/refs\/tags\///')" | |
# Fuck this | |
# If you ever get this to work, please let me know | |
# - name: Check if tag is on master | |
# run: | | |
# echo $(git branch --contains ${{ github.ref }} | xargs) | |
# if [[ $(git branch --contains ${{ github.ref }} --format="%(refname:short)" | xargs) != *"master"* ]]; then | |
# echo "Tag is not on master branch, exiting" | |
# exit 1 | |
# fi | |
- name: Parse fvm to set flutter version | |
run: echo "flutter_version=$(cat .fvm/fvm_config.json | jq -r .flutterSdkVersion)" >> $GITHUB_ENV | |
- name: Cache Flutter | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}-${{ env.flutter_channel }} | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
channel: ${{ env.flutter_channel }} | |
- name: Build apk | |
run: flutter build apk --target-platform android-arm,android-arm64 | |
- name: Rename apk | |
run: mv build/app/outputs/flutter-apk/app-release.apk ./FreeBuddy-${{ steps.clean_tag.outputs.tag }}.apk | |
# Changelogs can be more rich than tag message (where # is a comment, not a header :/) | |
- name: Get changelog | |
run: python scripts/get_changelog.py --version ${{ steps.clean_tag.outputs.tag }} > ./body-file.txt | |
# Just in case changelogs won't work out | |
# - name: Get tag message | |
# id: tag_message | |
# run: echo ::set-output name=message::$(git tag -l --format='%(contents)' ${{ github.ref }}) | |
- name: Create GH-Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: ./body-file.txt | |
files: ./FreeBuddy-${{ steps.clean_tag.outputs.tag }}.apk | |
fail_on_unmatched_files: true | |
# TODO: *Maybe* auto-upload to PlayStore some day? |