Skip to content

fix(ci): use Java 17 #11

fix(ci): use Java 17

fix(ci): use Java 17 #11

Workflow file for this run

name: Release
on:
push:
tags:
- "*.*.*"
workflow_dispatch:
jobs:
build:
name: Build app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Hack around https://github.com/actions/checkout/issues/290
run: |
git fetch --tags --force
- name: get version
run: echo "version=$(git describe --tags)" >> $GITHUB_ENV
- name: get previous version
run: echo "prev=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))" >> $GITHUB_ENV
- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: keystore.jks
encodedString: ${{ secrets.KEYSTORE_BASE64 }}
- name: Create key.properties
shell: bash
run: |
mkdir -p android
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
cache: gradle
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: generate changelog
run: |
dart pub global activate changelog_cli
dart pub global run changelog_cli generate -P markdown -s ${{env.prev}} -e ${{env.version}} > CHANGELOG.md
- name: upload changelog
uses: actions/upload-artifact@v3
with:
name: changelog
path: CHANGELOG.md
- name: Update version in YAML
run: |
dart pub global activate cider
dart pub global run cider version ${{env.version}}+${{github.run_number}}
- name: Get dependencies
run: flutter pub get
- name: Start Android Release Build
run: flutter build apk
- name: Upload Android Release
uses: actions/upload-artifact@v3
with:
name: android-release
path: build/app/outputs/flutter-apk/app-release.apk
- name: install packages
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev libjsoncpp-dev
- name: Configure Flutter for Linux
run: flutter config --enable-linux-desktop
- name: Start Linux Release Build
run: flutter build linux
- name: Zip Linux Release
uses: montudor/action-zip@v1
with:
args: zip -qq -r linux-release.zip build/linux/x64/release/bundle
- name: Upload Linux Release
uses: actions/upload-artifact@v3
with:
name: linux-release
path: linux-release.zip
deploy:
name: Deploy Android Build
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get Android Build from artifacts
uses: actions/download-artifact@v3
with:
name: android-release
- name: Get Linux Build from artifacts
uses: actions/download-artifact@v3
with:
name: linux-release
- name: Get changelog
uses: actions/download-artifact@v3
with:
name: changelog
- uses: ncipollo/release-action@v1
with:
artifacts: "app-release.apk,linux-release.zip"
bodyFile: "CHANGELOG.md"