diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml new file mode 100644 index 0000000..caee71d --- /dev/null +++ b/.github/workflows/mac-build.yml @@ -0,0 +1,52 @@ +# Build macOS à la demande, SANS rien publier : produit Jean.app en artifact +# téléchargeable depuis l'onglet Actions (visible seulement par le dépôt). +# Sert à tester le bundle avant de décider d'une vraie release (release.yml). +name: mac-build +on: + workflow_dispatch: + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - name: build + bundle Jean.app (arm64) + run: | + mkdir -p dist + CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 \ + go build -trimpath -ldflags="-s -w" -o dist/jean-darwin-arm64 ./cmd/jean + mkdir -p /tmp/jean.iconset + sips -s format png 'cmd/jean/icon.ico' --out /tmp/icon.png >/dev/null 2>&1 || true + for s in 16 32 128 256 512; do + sips -z $s $s /tmp/icon.png --out "/tmp/jean.iconset/icon_${s}x${s}.png" >/dev/null 2>&1 || true + done + iconutil -c icns /tmp/jean.iconset -o /tmp/jean.icns >/dev/null 2>&1 || true + app="dist/Jean.app" + mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources" + cp dist/jean-darwin-arm64 "$app/Contents/MacOS/jean" + chmod +x "$app/Contents/MacOS/jean" + cp /tmp/jean.icns "$app/Contents/Resources/jean.icns" 2>/dev/null || true + printf '%s\n' \ + '' \ + '' \ + '' \ + 'CFBundleNameJean' \ + 'CFBundleDisplayNameJean' \ + 'CFBundleExecutablejean' \ + 'CFBundleIdentifierlink.ajean.jean' \ + 'CFBundleIconFilejean' \ + 'CFBundlePackageTypeAPPL' \ + 'LSMinimumSystemVersion11.0' \ + 'LSUIElement' \ + 'NSHighResolutionCapable' \ + '' > "$app/Contents/Info.plist" + codesign --force --deep -s - "$app" || true + (cd dist && zip -qry Jean-macos-arm64.zip Jean.app && rm -rf Jean.app) + ls -l dist + - uses: actions/upload-artifact@v4 + with: + name: Jean-macos-arm64 + path: dist/Jean-macos-arm64.zip