mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
Build a macOS bundle for Intel and ARM (#266)
* Build a macOS bundle for Intel and ARM * Build icon.icns file in a script * Add imagemagick * Add macOS bundling to pre/tagged-release actions
This commit is contained in:
committed by
GitHub
parent
21c24f7fa1
commit
508d066700
34
.github/workflows/pre-release.yml
vendored
34
.github/workflows/pre-release.yml
vendored
@@ -84,36 +84,56 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: brew install gtk4 libadwaita
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
- name: Release Build
|
- name: Release Build
|
||||||
run: |
|
run: |
|
||||||
cargo build --release
|
cargo build --release
|
||||||
cp target/release/lan-mouse lan-mouse-macos-intel
|
cp target/release/lan-mouse lan-mouse-macos-intel
|
||||||
|
- name: Make icns
|
||||||
|
run: scripts/makeicns.sh
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: cargo bundle --release
|
||||||
|
- name: Zip bundle
|
||||||
|
run: |
|
||||||
|
cd target/debug/bundle/osx
|
||||||
|
zip -r "Lan Mouse macOS (Intel).zip" "Lan Mouse.app"
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-macos-intel
|
name: lan-mouse-macos-intel
|
||||||
path: lan-mouse-macos-intel
|
path: target/release/bundle/osx/Lan Mouse macOS (Intel).zip
|
||||||
|
|
||||||
macos-aarch64-release-build:
|
macos-aarch64-release-build:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: brew install gtk4 libadwaita
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
- name: Release Build
|
- name: Release Build
|
||||||
run: |
|
run: |
|
||||||
cargo build --release
|
cargo build --release
|
||||||
cp target/release/lan-mouse lan-mouse-macos-aarch64
|
cp target/release/lan-mouse lan-mouse-macos-aarch64
|
||||||
|
- name: Make icns
|
||||||
|
run: scripts/makeicns.sh
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: cargo bundle --release
|
||||||
|
- name: Zip bundle
|
||||||
|
run: |
|
||||||
|
cd target/debug/bundle/osx
|
||||||
|
zip -r "Lan Mouse macOS (ARM).zip" "Lan Mouse.app"
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-macos-aarch64
|
name: lan-mouse-macos-aarch64
|
||||||
path: lan-mouse-macos-aarch64
|
path: target/release/bundle/osx/Lan Mouse macOS (ARM).zip
|
||||||
|
|
||||||
pre-release:
|
pre-release:
|
||||||
name: "Pre Release"
|
name: "Pre Release"
|
||||||
needs: [windows-release-build, linux-release-build, macos-release-build]
|
needs: [windows-release-build, linux-release-build, macos-release-build, macos-aarch64-release-build]
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Download build artifacts
|
- name: Download build artifacts
|
||||||
@@ -127,6 +147,6 @@ jobs:
|
|||||||
title: "Development Build"
|
title: "Development Build"
|
||||||
files: |
|
files: |
|
||||||
lan-mouse-linux/lan-mouse
|
lan-mouse-linux/lan-mouse
|
||||||
lan-mouse-macos-intel/lan-mouse-macos-intel
|
lan-mouse-macos-intel/Lan Mouse macOS (Intel).zip
|
||||||
lan-mouse-macos-aarch64/lan-mouse-macos-aarch64
|
lan-mouse-macos-aarch64/Lan Mouse macOS (ARM).zip
|
||||||
lan-mouse-windows/lan-mouse-windows.zip
|
lan-mouse-windows/lan-mouse-windows.zip
|
||||||
|
|||||||
32
.github/workflows/rust.yml
vendored
32
.github/workflows/rust.yml
vendored
@@ -98,7 +98,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: brew install gtk4 libadwaita
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
@@ -107,18 +107,28 @@ jobs:
|
|||||||
run: cargo fmt --check
|
run: cargo fmt --check
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: cargo clippy --all-features --all-targets -- --deny warnings
|
run: cargo clippy --all-features --all-targets -- --deny warnings
|
||||||
|
- name: Make icns
|
||||||
|
run: scripts/makeicns.sh
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: cargo bundle
|
||||||
|
- name: Zip bundle
|
||||||
|
run: |
|
||||||
|
cd target/debug/bundle/osx
|
||||||
|
zip -r "Lan Mouse macOS (Intel).zip" "Lan Mouse.app"
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-macos
|
name: Lan Mouse macOS (Intel)
|
||||||
path: target/debug/lan-mouse
|
path: target/debug/bundle/osx/Lan Mouse macOS (Intel).zip
|
||||||
|
|
||||||
build-macos-aarch64:
|
build-macos-aarch64:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: brew install gtk4 libadwaita
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
@@ -127,8 +137,18 @@ jobs:
|
|||||||
run: cargo fmt --check
|
run: cargo fmt --check
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: cargo clippy --all-features --all-targets -- --deny warnings
|
run: cargo clippy --all-features --all-targets -- --deny warnings
|
||||||
|
- name: Make icns
|
||||||
|
run: scripts/makeicns.sh
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: cargo bundle
|
||||||
|
- name: Zip bundle
|
||||||
|
run: |
|
||||||
|
cd target/debug/bundle/osx
|
||||||
|
zip -r "Lan Mouse macOS (ARM).zip" "Lan Mouse.app"
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-macos-aarch64
|
name: Lan Mouse macOS (ARM)
|
||||||
path: target/debug/lan-mouse
|
path: target/debug/bundle/osx/Lan Mouse macOS (ARM).zip
|
||||||
|
|||||||
34
.github/workflows/tagged-release.yml
vendored
34
.github/workflows/tagged-release.yml
vendored
@@ -80,36 +80,56 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: brew install gtk4 libadwaita
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
- name: Release Build
|
- name: Release Build
|
||||||
run: |
|
run: |
|
||||||
cargo build --release
|
cargo build --release
|
||||||
cp target/release/lan-mouse lan-mouse-macos-intel
|
cp target/release/lan-mouse lan-mouse-macos-intel
|
||||||
|
- name: Make icns
|
||||||
|
run: scripts/makeicns.sh
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: cargo bundle --release
|
||||||
|
- name: Zip bundle
|
||||||
|
run: |
|
||||||
|
cd target/debug/bundle/osx
|
||||||
|
zip -r "Lan Mouse macOS (Intel).zip" "Lan Mouse.app"
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-macos-intel
|
name: lan-mouse-macos-intel
|
||||||
path: lan-mouse-macos-intel
|
path: target/release/bundle/osx/Lan Mouse macOS (Intel).zip
|
||||||
|
|
||||||
macos-aarch64-release-build:
|
macos-aarch64-release-build:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: brew install gtk4 libadwaita
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
- name: Release Build
|
- name: Release Build
|
||||||
run: |
|
run: |
|
||||||
cargo build --release
|
cargo build --release
|
||||||
cp target/release/lan-mouse lan-mouse-macos-aarch64
|
cp target/release/lan-mouse lan-mouse-macos-aarch64
|
||||||
|
- name: Make icns
|
||||||
|
run: scripts/makeicns.sh
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: cargo bundle --release
|
||||||
|
- name: Zip bundle
|
||||||
|
run: |
|
||||||
|
cd target/debug/bundle/osx
|
||||||
|
zip -r "Lan Mouse macOS (ARM).zip" "Lan Mouse.app"
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-macos-aarch64
|
name: lan-mouse-macos-aarch64
|
||||||
path: lan-mouse-macos-aarch64
|
path: target/release/bundle/osx/Lan Mouse macOS (ARM).zip
|
||||||
|
|
||||||
tagged-release:
|
tagged-release:
|
||||||
name: "Tagged Release"
|
name: "Tagged Release"
|
||||||
needs: [windows-release-build, linux-release-build, macos-release-build]
|
needs: [windows-release-build, linux-release-build, macos-release-build, macos-aarch64-release-build]
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Download build artifacts
|
- name: Download build artifacts
|
||||||
@@ -121,6 +141,6 @@ jobs:
|
|||||||
prerelease: false
|
prerelease: false
|
||||||
files: |
|
files: |
|
||||||
lan-mouse-linux/lan-mouse
|
lan-mouse-linux/lan-mouse
|
||||||
lan-mouse-macos-intel/lan-mouse-macos-intel
|
lan-mouse-macos-intel/Lan Mouse macOS (Intel).zip
|
||||||
lan-mouse-macos-aarch64/lan-mouse-macos-aarch64
|
lan-mouse-macos-aarch64/Lan Mouse macOS (ARM).zip
|
||||||
lan-mouse-windows/lan-mouse-windows.zip
|
lan-mouse-windows/lan-mouse-windows.zip
|
||||||
|
|||||||
@@ -89,3 +89,8 @@ libei_emulation = ["input-event/libei", "input-emulation/libei"]
|
|||||||
wlroots_emulation = ["input-emulation/wlroots"]
|
wlroots_emulation = ["input-emulation/wlroots"]
|
||||||
x11_emulation = ["input-emulation/x11"]
|
x11_emulation = ["input-emulation/x11"]
|
||||||
rdp_emulation = ["input-emulation/remote_desktop_portal"]
|
rdp_emulation = ["input-emulation/remote_desktop_portal"]
|
||||||
|
|
||||||
|
[package.metadata.bundle]
|
||||||
|
name = "Lan Mouse"
|
||||||
|
icon = ["target/icon.icns"]
|
||||||
|
identifier = "de.feschber.LanMouse"
|
||||||
|
|||||||
42
scripts/makeicns.sh
Executable file
42
scripts/makeicns.sh
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
$0: Make a macOS icns file from an SVG with ImageMagick and iconutil.
|
||||||
|
usage: $0 [SVG [ICNS [ICONSET]]
|
||||||
|
|
||||||
|
ARGUMENTS
|
||||||
|
SVG The SVG file to convert
|
||||||
|
Defaults to ./lan-mouse-gtk/resources/de.feschber.LanMouse.svg
|
||||||
|
ICNS The icns file to create
|
||||||
|
Defaults to ./target/icon.icns
|
||||||
|
ICONSET The iconset directory to create
|
||||||
|
Defaults to ./target/icon.iconset
|
||||||
|
This is just a temporary directory
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
svg="${1:-./lan-mouse-gtk/resources/de.feschber.LanMouse.svg}"
|
||||||
|
icns="${2:-./target/icon.icns}"
|
||||||
|
iconset="${3:-./target/icon.iconset}"
|
||||||
|
|
||||||
|
set -u
|
||||||
|
|
||||||
|
mkdir -p "$iconset"
|
||||||
|
magick convert -background none -resize 1024x1024 "$svg" "$iconset"/icon_512x512@2x.png
|
||||||
|
magick convert -background none -resize 512x512 "$svg" "$iconset"/icon_512x512.png
|
||||||
|
magick convert -background none -resize 256x256 "$svg" "$iconset"/icon_256x256.png
|
||||||
|
magick convert -background none -resize 128x128 "$svg" "$iconset"/icon_128x128.png
|
||||||
|
magick convert -background none -resize 64x64 "$svg" "$iconset"/icon_32x32@2x.png
|
||||||
|
magick convert -background none -resize 32x32 "$svg" "$iconset"/icon_32x32.png
|
||||||
|
magick convert -background none -resize 16x16 "$svg" "$iconset"/icon_16x16.png
|
||||||
|
cp "$iconset"/icon_512x512.png "$iconset"/icon_256x256@2x.png
|
||||||
|
cp "$iconset"/icon_256x256.png "$iconset"/icon_128x128@2x.png
|
||||||
|
cp "$iconset"/icon_32x32.png "$iconset"/icon_16x16@2x.png
|
||||||
|
iconutil -c icns "$iconset" -o "$icns"
|
||||||
Reference in New Issue
Block a user