add actions for automatically publishing apk on github

This commit is contained in:
Dr-Blank 2024-08-23 06:47:38 -04:00
parent 526e72c0c3
commit ddadc04f0d
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
3 changed files with 84 additions and 1 deletions

19
.github/release-drafter.yaml vendored Normal file
View file

@ -0,0 +1,19 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: '🚀 New Features'
labels:
- 'feature'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- title: '🛠 Maintenance'
labels:
- 'maintenance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$NEW_TAG

64
.github/workflows/flutter_release.yaml vendored Normal file
View file

@ -0,0 +1,64 @@
name: Flutter Release Workflow
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set Up Java
uses: actions/setup-java@v3.12.0
with:
distribution: "oracle"
java-version: "17"
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.24.1"
channel: "stable"
- name: Install dependencies
run: flutter pub get
# - name: Run tests
# run: flutter test
- name: Build APK
run: flutter build apk --release
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: release-apk
path: build/app/outputs/flutter-apk/app-release.apk
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate Release Notes
id: generate_release_notes
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: build/app/outputs/flutter-apk/app-release.apk
token: ${{ secrets.GITHUB_TOKEN }}
name: Release ${{ github.ref }}
tag: ${{ github.ref }}
# body: ${{ steps.generate_release_notes.outputs.notes }}

View file

@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.1.0+1
version: 0.0.1+1
environment:
sdk: ">=3.3.4 <4.0.0"