Skip to content

Merge pull request #16 from Thuenen-Forest-Ecosystems/v1.0.0 #4

Merge pull request #16 from Thuenen-Forest-Ecosystems/v1.0.0

Merge pull request #16 from Thuenen-Forest-Ecosystems/v1.0.0 #4

Workflow file for this run

name: Flutter Mobile CI
#https://medium.com/@colonal/automating-flutter-builds-and-releases-with-github-actions-77ccf4a1ccdd
#https://medium.com/lodgify-technology-blog/deploy-your-flutter-app-to-google-play-with-github-actions-f13a11c4492e
#https://medium.com/@fluttergems/packaging-and-distributing-flutter-desktop-apps-the-missing-guide-part-3-linux-24ef8d30a5b4
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build & Release Mobile
runs-on: macos-latest
steps:
#1 Checkout Repository
- name: Checkout Repository
uses: actions/checkout@v3
#2 Setup Java
- name: Set Up Java
uses: actions/[email protected]
with:
distribution: 'oracle'
java-version: '18'
#3 Setup Flutter
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.24.2'
#4 Install Dependencies
- name: Install Dependencies
run: flutter pub get
#5 Setup Keystore
- name: Decode Keystore
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/keystore.jks
- name: Create key.properties (PiceaAbies)
run: |
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
echo "storeFile=keystore.jks" >> android/key.properties
#6 Building APK
- name: Build APK
run: flutter build apk --release
#7 Building App Bundle (aab)
- name: Build appBundle
run: flutter build appbundle
#8 Build IPA ( IOS Build )
- name: Build IPA
run: flutter build ipa --no-codesign
- name: Compress Archives and IPAs
run: |
cd build
tar -czf ios_build.tar.gz ios
#9 Upload Artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Releases
path: |
build/app/outputs/flutter-apk/app-release.apk
build/app/outputs/bundle/release/app-release.aab
build/ios_build.tar.gz
# #10 Extract Version
#- name: Extract version from pubspec.yaml
# id: extract_version
# run: |
# version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r')
# echo "VERSION=$version" >> $GITHUB_ENV
#
# #11 Check if Tag Exists
#- name: Check if Tag Exists
# id: check_tag
# run: |
# if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then
# echo "TAG_EXISTS=true" >> $GITHUB_ENV
# else
# echo "TAG_EXISTS=false" >> $GITHUB_ENV
# fi
#
# #12 Modify Tag if it Exists
#- name: Modify Tag
# if: env.TAG_EXISTS == 'true'
# id: modify_tag
# run: |
# new_version="${{ env.VERSION }}-build-${{ github.run_number }}"
# echo "VERSION=$new_version" >> $GITHUB_ENV
#
# #13 Create Release
#- name: Create Release
# uses: ncipollo/release-action@v1
# with:
# artifacts: "build/app/outputs/flutter-apk/app-release.apk,build/app/outputs/bundle/release/app-release.aab,build/ios_build.tar.gz"
# tag: v${{ env.VERSION }}
# token: ${{ secrets.TOKEN }}