deploy_android #9
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: deploy_android | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install and set Flutter version | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.x' | |
channel: 'stable' | |
- name: Flutter Doctor | |
run: flutter doctor | |
- name: Install Melos | |
run: dart pub global activate melos | |
- name: Melos Bootstrap | |
run: dart run melos bootstrap | |
- name: Set version | |
run: dart run melos set_version | |
- name: Build Android | |
run: cd apps/app_main && flutter build apk --release | |
- name: Extract version from pubspec.yaml | |
id: extract_version | |
run: | | |
version=$(grep '^version:' apps/app_main/pubspec.yaml | sed 's/version: //') | |
echo "version=$version" >> $GITHUB_ENV | |
- name: Install GitHub CLI | |
run: sudo apt-get install gh -y | |
- name: Create GitHub Release and Upload APK | |
run: | | |
gh release create v${{ env.version }} apps/app_main/build/app/outputs/flutter-apk/app-release.apk --title "Release v${{ env.version }}" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash |