Update ci.yml #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: android | |
os: ubuntu-latest | |
targets: aab,apk | |
- platform: windows | |
os: windows-latest | |
aarch: amd64 | |
targets: exe | |
# - platform: windows | |
# os: windows-latest | |
# aarch: 386 | |
# targets: exe | |
# - platform: linux | |
# os: ubuntu-latest | |
# aarch: 386 | |
# targets: appimage | |
- platform: linux | |
os: ubuntu-latest | |
aarch: amd64 | |
targets: appimage | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.pub-cache | |
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pub-cache- | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.10.6' | |
channel: 'stable' | |
- name: Setup Java | |
if: matrix.platform == 'android' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: 11 | |
- name: Setup Flutter Distributor | |
if: matrix.platform == 'windows' || matrix.platform == 'linux' | |
# shell: powershell | |
run: | | |
dart pub global activate flutter_distributor | |
where flutter_distributor | |
- name: Get Dependencies | |
run: | | |
make get | |
- name: Generate | |
run: | | |
make gen | |
make translate | |
- name: Get Libs ${{ matrix.platform }} | |
run: | | |
make ${{ matrix.platform }}-libs | |
- name: Release ${{ matrix.platform }} | |
run: | | |
make ${{ matrix.platform }}-release | |
- name: Copy to out | |
run: | | |
mkdir out | |
IFS=',' read -r -a EXT_ARRAY <<< "${{ matrix.targets }}" | |
# Loop over extensions | |
for EXT in "${EXT_ARRAY[@]}"; do | |
# Find all files with this extension in SRC_DIR, and copy them to DST_DIR | |
find "." -type f -name "*.$EXT" -exec cp {} "out" \; | |
done | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.platform }} | |
path: ./out | |
retention-days: 2 | |
- name: Create or Update Draft Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: ./out/* | |
name: "draft" | |
tag_name: "draft" | |
prerelease: true | |
overwrite: true |