mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
81 lines
2.2 KiB
YAML
81 lines
2.2 KiB
YAML
name: Build for Mac
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
description: "tag"
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-mac-app:
|
|
name: Release Mac
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
flutter-version-file: pubspec.yaml
|
|
|
|
- name: Set and Extract version
|
|
shell: pwsh
|
|
run: lib/scripts/build.ps1
|
|
|
|
- name: pick tooltip fix
|
|
working-directory: ${{ env.FLUTTER_ROOT }}
|
|
run: |
|
|
git config --global user.name "ci"
|
|
git config --global user.email "example@example.com"
|
|
git stash || true
|
|
git cherry-pick 56956c33ef102ac0b5fc46b62bd2dd9f50a86616 --no-edit
|
|
git reset --soft HEAD~1
|
|
git stash pop || true
|
|
continue-on-error: true
|
|
|
|
- name: apply modal barrier patch
|
|
working-directory: ${{ env.FLUTTER_ROOT }}
|
|
run: git apply $GITHUB_WORKSPACE/lib/scripts/modal_barrier_patch.diff || true
|
|
continue-on-error: true
|
|
|
|
- name: apply mouse cursor patch
|
|
working-directory: ${{ env.FLUTTER_ROOT }}
|
|
run: git apply $GITHUB_WORKSPACE/lib/scripts/mouse_cursor_patch.diff || true
|
|
continue-on-error: true
|
|
|
|
- name: Build Mac
|
|
run: flutter build macos --release --dart-define-from-file=pili_release.json
|
|
|
|
- name: Prepare Upload
|
|
run: |
|
|
npm install --global create-dmg
|
|
create-dmg build/macos/Build/Products/Release/PiliPlus.app || true
|
|
continue-on-error: true
|
|
|
|
- name: Rename DMG
|
|
run: mv PiliPlus*.dmg PiliPlus_macos_${{ env.version }}.dmg
|
|
|
|
- name: Release
|
|
if: ${{ github.event.inputs.tag != '' }}
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.event.inputs.tag }}
|
|
name: ${{ github.event.inputs.tag }}
|
|
files: |
|
|
PiliPlus_macos_*.dmg
|
|
|
|
- name: Upload macos release
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
archive: false
|
|
name: macOS-release
|
|
path: PiliPlus_macos_*.dmg
|