158 lines
4.7 KiB
YAML
158 lines
4.7 KiB
YAML
name: release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
go_version: '1.16'
|
|
flutter_channel: 'stable'
|
|
flutter_version: '2.10.3'
|
|
|
|
jobs:
|
|
|
|
ci-pass:
|
|
name: CI is green
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- check_release
|
|
- build_release_assets
|
|
steps:
|
|
- run: exit 0
|
|
|
|
check_release:
|
|
name: Check release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: ${{ github.event.inputs.repo }}
|
|
ref: 'master'
|
|
- name: Checkout submodules
|
|
run: git submodule update --init --recursive
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ env.go_version }}
|
|
- name: Check release
|
|
run: |
|
|
cd ci
|
|
go run cmd/check_release
|
|
|
|
build_release_assets:
|
|
name: Build release assets
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- target: linux
|
|
host: ubuntu-latest
|
|
- target: windows
|
|
host: windows-latest
|
|
- target: macos
|
|
host: macos-latest
|
|
- target: ios
|
|
host: macos-latest
|
|
- target: android-32
|
|
host: ubuntu-latest
|
|
- target: android-arm64
|
|
host: ubuntu-latest
|
|
- target: android-x86_64
|
|
host: ubuntu-latest
|
|
needs: [ style ]
|
|
runs-on: ${{ matrix.config.host }}
|
|
|
|
env:
|
|
TARGET: ${{ matrix.config.target }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup golang
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ env.go_version }}
|
|
|
|
- id: check_asset
|
|
name: Check asset
|
|
run: |
|
|
cd ci
|
|
go run cmd/check_asset
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD"
|
|
name: Cache Go modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD"
|
|
name: Cache Flutter dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/hostedtoolcache/flutter
|
|
key: ${{ runner.OS }}-flutter-cache-${{ env.flutter_version }}-${{ env.flutter_channel }}-${{ hashFiles('**/pubspec.lock') }}
|
|
restore-keys: |
|
|
${{ runner.OS }}-flutter-cache-${{ env.flutter_version }}-${{ env.flutter_channel }}
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD"
|
|
uses: subosito/flutter-action@v2.3.0
|
|
with:
|
|
channel: ${{ env.flutter_channel }}
|
|
flutter-version: ${{ env.flutter_version }}
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD"
|
|
name: Cache pub dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ env.PUB_CACHE }}
|
|
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
|
|
restore-keys: ${{ runner.os }}-pub-
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD" && ( ${{ env.TARGET }} == "android-arm32" | ${{ env.TARGET }} == "android-arm64" | ${{ env.TARGET }} == "android-x86_64" )
|
|
name: Setup java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 8
|
|
cache: 'gradle'
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD" && ( ${{ env.TARGET }} == "android-arm32" | ${{ env.TARGET }} == "android-arm64" | ${{ env.TARGET }} == "android-x86_64" )
|
|
name: Setup android tools
|
|
uses: maxim-lobanov/setup-android-tools@v1
|
|
with:
|
|
packages: |
|
|
platform-tools
|
|
platforms;android-32
|
|
build-tools;33.0.0
|
|
ndk;22.1.7171670
|
|
cache: true
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD" && ( ${{ env.TARGET }} == "windows" )
|
|
name: Setup msys2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
install: gcc make
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD" && ( ${{ env.TARGET }} == "windows" )
|
|
name: Setup msys2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
install: gcc make
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD" && ( ${{ env.TARGET }} == "windows" )
|
|
name: Install zip
|
|
uses: montudor/action-zip@v1
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD" && ( ${{ env.TARGET }} == "linux" )
|
|
name: Install appimage
|
|
uses: AppImageCrafters/build-appimage@master
|
|
|
|
- if: ${{steps.check_asset.outputs.*}} == "BUILD" && ( ${{ env.TARGET }} == "linux" | ${{ env.TARGET }} == "windows" ${{ env.TARGET }} == "macos" )
|
|
name: Install appimage
|
|
run: |
|
|
go install github.com/go-flutter-desktop/hover@latest
|
|
|