2022-03-22 03:08:09 +00:00
|
|
|
name: release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
|
|
|
go_version: '1.16'
|
|
|
|
flutter_channel: 'stable'
|
|
|
|
flutter_version: '2.10.3'
|
2022-03-22 03:19:35 +00:00
|
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
2022-03-22 03:08:09 +00:00
|
|
|
|
|
|
|
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
|
2022-03-22 03:15:42 +00:00
|
|
|
go run ./cmd/check_release
|
2022-03-22 03:08:09 +00:00
|
|
|
|
|
|
|
build_release_assets:
|
2022-03-22 03:15:42 +00:00
|
|
|
needs:
|
|
|
|
- check_release
|
2022-03-22 03:08:09 +00:00
|
|
|
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
|
|
|
|
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
|
2022-03-22 03:15:42 +00:00
|
|
|
go run ./cmd/check_asset
|
2022-03-22 03:08:09 +00:00
|
|
|
|
|
|
|
- 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
|
2022-03-22 03:09:34 +00:00
|
|
|
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 }}
|
2022-03-22 03:08:09 +00:00
|
|
|
|
|
|
|
- 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
|
2022-03-22 03:11:12 +00:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: 8
|
|
|
|
cache: 'gradle'
|
2022-03-22 03:08:09 +00:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|