mirror of
https://github.com/rememberber/MooTool.git
synced 2026-12-01 03:18:19 +08:00
153 lines
4.9 KiB
YAML
153 lines
4.9 KiB
YAML
name: Next Flutter
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'next-flutter/**'
|
|
- '.github/workflows/next-flutter-build.yml'
|
|
tags:
|
|
- 'next-flutter-v*'
|
|
pull_request:
|
|
paths:
|
|
- 'next-flutter/**'
|
|
- '.github/workflows/next-flutter-build.yml'
|
|
workflow_dispatch:
|
|
inputs:
|
|
package:
|
|
description: Build unsigned packages
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
check:
|
|
name: Analyze and unit tests
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
defaults:
|
|
run:
|
|
working-directory: next-flutter
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
cache: true
|
|
- run: python3 scripts/check-release.py --root .
|
|
- name: Validate tag when present
|
|
if: github.ref_type == 'tag'
|
|
run: python3 scripts/check-release.py --root . --tag "${{ github.ref_name }}"
|
|
- run: flutter pub get
|
|
- run: dart format --output=none --set-exit-if-changed lib test
|
|
- run: flutter analyze
|
|
- run: flutter test test/unit --reporter compact
|
|
- name: Unsigned release reminder
|
|
if: github.ref_type == 'tag'
|
|
run: echo "::warning::next-flutter packages are intentionally unsigned. The client downloads, verifies SHA-512, then asks the user to open the installer. It never reports automatic install success."
|
|
|
|
package-macos:
|
|
name: Unsigned macOS DMG
|
|
needs: check
|
|
if: github.ref_type == 'tag' || (github.event_name == 'workflow_dispatch' && inputs.package)
|
|
runs-on: macos-15
|
|
defaults:
|
|
run:
|
|
working-directory: next-flutter
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
cache: true
|
|
- name: Build unsigned DMG
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
|
CODE_SIGNING_ALLOWED: 'NO'
|
|
run: bash scripts/build-macos.sh
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: next-flutter-macos
|
|
path: next-flutter/dist/*.dmg
|
|
if-no-files-found: error
|
|
|
|
package-windows:
|
|
name: Unsigned Windows zip
|
|
needs: check
|
|
if: github.ref_type == 'tag' || (github.event_name == 'workflow_dispatch' && inputs.package)
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
working-directory: next-flutter
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
cache: true
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
- name: Build unsigned portable zip
|
|
shell: bash
|
|
run: bash scripts/build-windows.sh
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: next-flutter-windows
|
|
path: |
|
|
next-flutter/dist/*.zip
|
|
next-flutter/dist/*.exe
|
|
if-no-files-found: error
|
|
|
|
package-linux:
|
|
name: Unsigned Linux deb
|
|
needs: check
|
|
if: github.ref_type == 'tag' || (github.event_name == 'workflow_dispatch' && inputs.package)
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: next-flutter
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
cache: true
|
|
- name: Linux build deps
|
|
run: sudo apt-get update && sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
|
|
- name: Build unsigned deb
|
|
run: bash scripts/build-linux.sh
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: next-flutter-linux
|
|
path: |
|
|
next-flutter/dist/*.deb
|
|
next-flutter/dist/*.AppImage
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
name: GitHub Release (not Latest)
|
|
needs: [package-macos, package-windows, package-linux]
|
|
if: github.ref_type == 'tag'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
- name: Create product Release
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
version="$(python3 -c 'import re,pathlib; print(re.search(r"^version:\s*([0-9][^\s+]+)", pathlib.Path("next-flutter/pubspec.yaml").read_text(), re.M).group(1))')"
|
|
notes="next-flutter/release-notes/${version}.md"
|
|
mapfile -t files < <(find artifacts -type f \( -name '*.dmg' -o -name '*.zip' -o -name '*.exe' -o -name '*.deb' -o -name '*.AppImage' \))
|
|
gh release create "${{ github.ref_name }}" "${files[@]}" \
|
|
--title "MooTool Next Flutter ${version}" \
|
|
--notes-file "$notes" \
|
|
--latest=false
|
|
echo "::warning::Did not update update-manifest.json. Enable the next-flutter node only after assets are reachable. make_latest is false."
|