chore(release): drop flatpak, add macOS .dmg, hide Windows console
- .github/workflows/release.yml: remove the build-flatpak job; matrix- add macOS (arm64 + x86_64) that builds H7CAD.app by hand, renders .icns from assets/logo.svg via librsvg + iconutil, and packages a UDZO .dmg. AppImage path updated to packaging/H7CAD.desktop. - packaging/H7CAD.desktop: moved out of flatpak/ so the AppImage job doesn't depend on a Flatpak layout. - packaging/Info.plist: macOS bundle template; __VERSION__ swapped for the release tag at build time. - flatpak/: deleted (manifests, metainfo, desktop, builder cache). - src/main.rs: `#![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")]` so the Windows GUI binary no longer spawns a console window alongside it (debug builds keep the console for log output). - README: add macOS install section, document Gatekeeper / SmartScreen on first launch since the binaries are unsigned. Bump to 0.3.5. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
50281c6a05
commit
9527509ea2
10 changed files with 153 additions and 210 deletions
129
.github/workflows/release.yml
vendored
129
.github/workflows/release.yml
vendored
|
|
@ -6,55 +6,6 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-flatpak:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install flatpak and flatpak-builder
|
||||
run: |
|
||||
sudo apt-get update -q
|
||||
sudo apt-get install -y flatpak flatpak-builder
|
||||
|
||||
- name: Add Flathub remote
|
||||
run: |
|
||||
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
- name: Install runtimes
|
||||
run: |
|
||||
flatpak install -y --user \
|
||||
org.freedesktop.Platform//24.08 \
|
||||
org.freedesktop.Sdk//24.08 \
|
||||
org.freedesktop.Sdk.Extension.rust-stable//24.08
|
||||
|
||||
- name: Generate cargo-sources.json
|
||||
run: |
|
||||
pip3 install tomlkit aiohttp
|
||||
git clone --depth=1 https://github.com/flatpak/flatpak-builder-tools.git /tmp/flatpak-builder-tools
|
||||
python3 /tmp/flatpak-builder-tools/cargo/flatpak-cargo-generator.py \
|
||||
Cargo.lock -o flatpak/cargo-sources.json
|
||||
|
||||
- name: Build Flatpak
|
||||
run: |
|
||||
flatpak-builder --force-clean --user --repo=repo build-dir \
|
||||
flatpak/io.github.HakanSeven12.H7CAD.ci.yml
|
||||
|
||||
- name: Create bundle
|
||||
run: |
|
||||
flatpak build-bundle repo H7CAD.flatpak io.github.HakanSeven12.H7CAD
|
||||
|
||||
- name: Upload bundle to release
|
||||
if: github.event_name == 'release'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
mv H7CAD.flatpak H7CAD-${{ github.ref_name }}-linux-x86_64.flatpak
|
||||
gh release upload ${{ github.ref_name }} H7CAD-${{ github.ref_name }}-linux-x86_64.flatpak --clobber --repo ${{ github.repository }}
|
||||
|
||||
build-appimage:
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
|
|
@ -84,7 +35,7 @@ jobs:
|
|||
mkdir -p AppDir/usr/share/applications
|
||||
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
|
||||
cp target/release/H7CAD AppDir/usr/bin/H7CAD
|
||||
cp flatpak/io.github.HakanSeven12.H7CAD.desktop AppDir/usr/share/applications/
|
||||
cp packaging/H7CAD.desktop AppDir/usr/share/applications/io.github.HakanSeven12.H7CAD.desktop
|
||||
rsvg-convert -w 256 -h 256 assets/logo.svg \
|
||||
-o AppDir/usr/share/icons/hicolor/256x256/apps/io.github.HakanSeven12.H7CAD.png
|
||||
|
||||
|
|
@ -99,7 +50,7 @@ jobs:
|
|||
run: |
|
||||
./linuxdeploy-x86_64.AppImage \
|
||||
--appdir AppDir \
|
||||
--desktop-file flatpak/io.github.HakanSeven12.H7CAD.desktop \
|
||||
--desktop-file AppDir/usr/share/applications/io.github.HakanSeven12.H7CAD.desktop \
|
||||
--icon-file AppDir/usr/share/icons/hicolor/256x256/apps/io.github.HakanSeven12.H7CAD.png \
|
||||
--output appimage
|
||||
mv H7CAD*.AppImage H7CAD.AppImage
|
||||
|
|
@ -134,3 +85,79 @@ jobs:
|
|||
run: |
|
||||
mv target/release/H7CAD.exe H7CAD-${{ github.ref_name }}-windows-x86_64.exe
|
||||
gh release upload ${{ github.ref_name }} H7CAD-${{ github.ref_name }}-windows-x86_64.exe --clobber --repo ${{ github.repository }}
|
||||
|
||||
build-macos:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- runner: macos-14 # Apple Silicon (arm64)
|
||||
target: aarch64-apple-darwin
|
||||
arch: arm64
|
||||
- runner: macos-13 # Intel (x86_64)
|
||||
target: x86_64-apple-darwin
|
||||
arch: x86_64
|
||||
runs-on: ${{ matrix.runner }}
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Install librsvg (for rsvg-convert)
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: "1"
|
||||
run: brew install librsvg
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Build .icns from SVG
|
||||
run: |
|
||||
mkdir -p H7CAD.iconset
|
||||
# Render all the sizes Apple expects in an .icns.
|
||||
for SIZE in 16 32 64 128 256 512 1024; do
|
||||
rsvg-convert -w $SIZE -h $SIZE assets/logo.svg -o H7CAD.iconset/icon_${SIZE}x${SIZE}.png
|
||||
done
|
||||
# @2x retina variants (half-size base name)
|
||||
for BASE in 16 32 128 256 512; do
|
||||
DOUBLE=$((BASE * 2))
|
||||
cp H7CAD.iconset/icon_${DOUBLE}x${DOUBLE}.png H7CAD.iconset/icon_${BASE}x${BASE}@2x.png
|
||||
done
|
||||
iconutil -c icns H7CAD.iconset -o AppIcon.icns
|
||||
|
||||
- name: Assemble .app bundle
|
||||
run: |
|
||||
APP=H7CAD.app
|
||||
rm -rf "$APP"
|
||||
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
|
||||
cp target/${{ matrix.target }}/release/H7CAD "$APP/Contents/MacOS/H7CAD"
|
||||
chmod +x "$APP/Contents/MacOS/H7CAD"
|
||||
cp AppIcon.icns "$APP/Contents/Resources/AppIcon.icns"
|
||||
# Substitute version into Info.plist.
|
||||
VERSION="${{ github.ref_name }}"
|
||||
VERSION="${VERSION#v}"
|
||||
[ -z "$VERSION" ] && VERSION="0.0.0"
|
||||
sed "s/__VERSION__/$VERSION/g" packaging/Info.plist > "$APP/Contents/Info.plist"
|
||||
|
||||
- name: Create .dmg
|
||||
run: |
|
||||
hdiutil create \
|
||||
-volname "H7CAD" \
|
||||
-srcfolder H7CAD.app \
|
||||
-ov -format UDZO \
|
||||
H7CAD.dmg
|
||||
|
||||
- name: Upload .dmg to release
|
||||
if: github.event_name == 'release'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
mv H7CAD.dmg H7CAD-${{ github.ref_name }}-macos-${{ matrix.arch }}.dmg
|
||||
gh release upload ${{ github.ref_name }} H7CAD-${{ github.ref_name }}-macos-${{ matrix.arch }}.dmg --clobber --repo ${{ github.repository }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue