perf: performance lints applied #30
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- rc | |
- beta | |
- nightly | |
- hotfix | |
- "*.x" | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ windows, linux, macos] | |
include: | |
- target: windows | |
runner: windows-latest | |
channel: 'beta' | |
artifact: build/windows/x64/runner/Release | |
- target: linux | |
runner: ubuntu-latest | |
channel: 'stable' | |
artifact: build/linux/x64/release/bundle | |
- target: macos | |
runner: macos-latest | |
channel: 'stable' | |
artifact: "build/macos/Build/Products/Release/Past Paper Master.app" | |
runs-on: ${{ matrix.runner }} | |
environment: ${{ github.ref_name }} | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2.10.0 | |
with: | |
channel: ${{ matrix.channel }} | |
cache: true | |
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
architecture: x64 # action no current support for arm64 | |
- name: Install Dependencies (windows) | |
if: ${{ matrix.runner == 'windows-latest' }} | |
run: | | |
flutter config --enable-windows-desktop | |
- name: Install Dependencies (linux) | |
if: ${{ matrix.runner == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev | |
flutter config --enable-linux-desktop | |
- name: Install Dependencies (macos) | |
if: ${{ matrix.runner == 'macos-latest' }} | |
run: | | |
flutter config --enable-macos-desktop | |
- name: Build Flutter ${{ matrix.target }} | |
run: | | |
make build ${{ matrix.target }} | |
- name: Zip artifact (Windows) | |
if: ${{ matrix.runner == 'windows-latest' }} | |
shell: pwsh | |
run: Compress-Archive "${{ matrix.artifact }}" "ppm-${{ matrix.target }}.zip" | |
- name: Zip artifact (Linux) | |
if: ${{ matrix.runner == 'ubuntu-latest' }} | |
shell: bash | |
run: tar -C "$(dirname ${{ matrix.artifact }})" -czf "ppm-${{ matrix.target }}.tar.gz" "$(basename ${{ matrix.artifact }})" --transform "s/$(basename ${{ matrix.artifact }})/PastPaperMaster/" | |
- name: Zip artifact (MacOS) | |
if: ${{ matrix.runner == 'macos-latest' }} | |
shell: bash | |
run: tar -C "$(dirname "${{ matrix.artifact }}")" -czf "ppm-${{ matrix.target }}.tar.gz" "$(basename "${{ matrix.artifact }}")" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ppm-${{ matrix.target }} | |
path: ppm-${{ matrix.target }}.* |