Skip to content

yarn upgrade --latest && yarn build (#2402) #5616

yarn upgrade --latest && yarn build (#2402)

yarn upgrade --latest && yarn build (#2402) #5616

---
# See: https://flutter.dev/desktop#distribution
# REF: https://github.com/google/flutter-desktop-embedding/blob/master/.github/workflows/ci.yml
name: Flutter Build
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
flutter_build_desktop_app:
runs-on: ${{ matrix.runner_machine }}
timeout-minutes: 40
strategy:
fail-fast: false # I want results from all OSes even if one fails.
matrix:
os: [ubuntu, windows, macos-intel-silicon, macos-latest]
include: # See: https://docs.github.com/ja/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-environment-variables-in-a-matrix
- os: ubuntu
runner_machine: ubuntu-latest
subcommand: linux
setup_for_flutter_desktop_script: .github/scripts/linux/install_additional_requirements_for_flutter.sh
prepare_to_pack_script: .github/scripts/linux/prepare_to_pack.sh
distribution_path: build/linux/x64/release
- os: windows
runner_machine: windows-latest
subcommand: windows
setup_for_flutter_desktop_script: .github/scripts/windows/install_additional_requirements_for_flutter.sh
prepare_to_pack_script: .github/scripts/windows/prepare_to_pack.sh
distribution_path: build/windows/x64/runner/Release # https://docs.flutter.dev/release/breaking-changes/windows-build-architecture
- os: macos-intel-silicon
runner_machine: macos-13
subcommand: macos
setup_for_flutter_desktop_script: .github/scripts/macos/install_additional_requirements_for_flutter.sh
prepare_to_pack_script: .github/scripts/macos/prepare_to_pack.sh
distribution_path: build/macos/Build/Products/release
- os: macos-latest
runner_machine: macos-latest
subcommand: macos
setup_for_flutter_desktop_script: .github/scripts/macos/install_additional_requirements_for_flutter.sh
prepare_to_pack_script: .github/scripts/macos/prepare_to_pack.sh
distribution_path: build/macos/Build/Products/release
steps:
- uses: actions/checkout@v4
- uses: subosito/[email protected]
with:
cache: true
- name: setup flutter channel
shell: bash
run: ./scripts/setup_flutter.sh
- name: setup flutter desktop
shell: bash
run: ${{ matrix.setup_for_flutter_desktop_script }}
- name: doctor
run: flutter doctor -v
- name: install dependencies
run: flutter pub get
- name: build
run: flutter build ${{ matrix.subcommand }} --release --dart-define SENTRY_DSN=${{ secrets.SENTRY_DSN }}
- name: prepare to pack
shell: bash
run: ${{ matrix.prepare_to_pack_script }}
# - name: debug
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# - name: set output path
# shell: bash
# run: |-
# path=$(echo ${{ matrix.distribution_path }} | sed -e 's/_mode_/${{ matrix.mode }}/g')
# echo "artifact_target=$path" >> $GITHUB_ENV
- name: output build info
shell: bash
run: .github/scripts/output_build_info.sh ${{ matrix.distribution_path }}
- name: diff check
run: git diff --exit-code
- uses: actions/upload-artifact@v4
with:
name: pedax-${{ matrix.os }}
path: ${{ matrix.distribution_path }}