Skip to content

v1.1.0+31

v1.1.0+31 #45

Workflow file for this run

name: Flutter release
on:
release:
types: [published]
workflow_dispatch:
env:
ANDROID_BUILD_PATH: ${{ vars.ANDROID_BUILD_PATH }}
LINUX_BUILD_PATH: ${{ vars.LINUX_BUILD_PATH }}
MACOS_BUILD_PATH: ${{ vars.MACOS_BUILD_PATH }}
WINDOWS_BUILD_PATH: ${{ vars.WINDOWS_BUILD_PATH }}
MACOS_DMG_PATH: installers/dmg_creator
jobs:
release-android-and-linux:
runs-on: ubuntu-latest
env:
LINUX_ZIP: Vernet-${{github.ref_name}}-linux.zip
ANDROID_APK_ARM_V7A: app-armeabi-v7a-dev-release.apk
ANDROID_APK_ARM_V8A: app-arm64-v8a-dev-release.apk
ANDROID_APK_x86_64: app-x86_64-dev-release.apk
steps:
- name: Checkout
uses: actions/checkout@v3
# setup java because we are building for android too
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'
- name: Flutter action
uses: subosito/[email protected]
with:
channel: stable
- name: Download pub dependencies
run: flutter pub get
- name: Run build_runner
run: dart run build_runner build --delete-conflicting-outputs
- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: key.jks
encodedString: '${{ secrets.ANDROID_KEYSTORE_BASE64 }}'
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" >> android/key.properties
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
- name: Create artifacts directory
run: mkdir -p artifacts
- name: Install dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Build Android App Bundle
run: flutter build appbundle --flavor store
- name: 'Setup Ruby, JRuby and TruffleRuby'
uses: ruby/[email protected]
with:
ruby-version: 3.1.2
- name: Cache bundle dependencies
uses: actions/cache@v2
with:
path: android/vendor/bundle
key: '${{ runner.os }}-gems-${{ hashFiles(''**/Gemfile.lock'') }}'
restore-keys: '${{ runner.os }}-gems-'
- name: Download bundle dependencies
working-directory: android/
run: |
gem install bundler:2.3.20
bundle config path vendor/bundle
bundle install
- name: Release to Google Play
env:
SUPPLY_PACKAGE_NAME: '${{ secrets.ANDROID_PACKAGE_NAME }}'
SUPPLY_JSON_KEY_DATA: '${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}'
working-directory: android/
run: bundle exec fastlane android ${{ github.event.release.prerelease && 'beta' || 'deploy' }}
- name: Build Android App and Linux Bundle
# Use signing keys for release instead of debug
run: |
flutter build apk --split-per-abi --flavor dev
flutter build linux --release
- name: Rename ANDROID APKs
run: |
mv ${{ env.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_ARM_V7A}} ${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V7A}}
mv ${{ env.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_ARM_V8A}} ${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V8A}}
mv ${{ env.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_x86_64}} ${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_x86_64}}
- name: Linux Archive
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.LINUX_ZIP }}
directory: ${{ env.LINUX_BUILD_PATH }}
- name: Publish Android Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V7A}}
${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V8A}}
${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_x86_64}}
- name: Publish Linux Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.LINUX_BUILD_PATH }}/${{ env.LINUX_ZIP }}
release-macos:
runs-on: macos-latest
env:
MACOS_ZIP: Vernet-${{github.ref_name}}-macos.zip
MACOS_DMG: Vernet-${{github.ref_name}}-macos.dmg
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Flutter action
uses: subosito/[email protected]
with:
channel: stable
- name: Download pub dependencies
run: flutter pub get
- name: Run build_runner
run: dart run build_runner build --delete-conflicting-outputs
- name: Build macos release
run: flutter build macos --release
- name: Archive macos
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.MACOS_ZIP }}
directory: ${{ env.MACOS_BUILD_PATH }}
- name: Install Node 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Appdmg and Create dmg
working-directory: ${{ env.MACOS_DMG_PATH }}
run: |
npm install -g appdmg
appdmg ./config.json ./${{ env.MACOS_DMG }}
- name: Publish macOS Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{ env.MACOS_BUILD_PATH }}/${{ env.MACOS_ZIP }}
${{ env.MACOS_DMG_PATH }}/${{ env.MACOS_DMG }}
release-windows:
runs-on: windows-latest
env:
WINDOWS_ZIP: Vernet-${{github.ref_name}}-windows.zip
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Flutter action
uses: subosito/[email protected]
with:
channel: stable
- name: Download pub dependencies
run: flutter pub get
- name: Run build_runner
run: dart run build_runner build --delete-conflicting-outputs
- name: Build windows release
run: flutter build windows --release
- name: Archive windows Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.WINDOWS_ZIP }}
directory: ${{ env.WINDOWS_BUILD_PATH }}
- name: Publish Windows Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.WINDOWS_BUILD_PATH }}/${{ env.WINDOWS_ZIP }}