Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 74 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Package
shell: pwsh
run: |
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md -DestinationPath openmouse-bridge-windows-x64.zip
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md,driver -DestinationPath openmouse-bridge-windows-x64.zip
(Get-FileHash openmouse-bridge-windows-x64.zip -Algorithm SHA256).Hash.ToLower() + " openmouse-bridge-windows-x64.zip" | Set-Content openmouse-bridge-windows-x64.zip.sha256
- uses: actions/upload-artifact@v4
with:
Expand All @@ -50,17 +50,79 @@ jobs:
openmouse-bridge-windows-x64.zip
openmouse-bridge-windows-x64.zip.sha256
if-no-files-found: error
- name: Publish rolling development release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

linux-build:
name: Linux release artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release --locked
# The WinUSB driver folder is Windows-only, so it is not bundled here.
- name: Package
run: |
tar -czf openmouse-bridge-linux-x64.tar.gz README.md -C target/release openmouse-bridge
sha256sum openmouse-bridge-linux-x64.tar.gz > openmouse-bridge-linux-x64.tar.gz.sha256
- uses: actions/upload-artifact@v4
with:
name: openmouse-bridge-linux-x64
path: |
openmouse-bridge-linux-x64.tar.gz
openmouse-bridge-linux-x64.tar.gz.sha256
if-no-files-found: error

macos-build:
name: macOS release artifact
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: Build universal binary
run: |
cargo build --release --locked --target aarch64-apple-darwin
cargo build --release --locked --target x86_64-apple-darwin
lipo -create \
target/aarch64-apple-darwin/release/openmouse-bridge \
target/x86_64-apple-darwin/release/openmouse-bridge \
-output openmouse-bridge
chmod +x openmouse-bridge
# The WinUSB driver folder is Windows-only, so it is not bundled here.
- name: Package
run: |
zip openmouse-bridge-macos-universal.zip openmouse-bridge README.md
shasum -a 256 openmouse-bridge-macos-universal.zip > openmouse-bridge-macos-universal.zip.sha256
- uses: actions/upload-artifact@v4
with:
name: openmouse-bridge-macos-universal
path: |
openmouse-bridge-macos-universal.zip
openmouse-bridge-macos-universal.zip.sha256
if-no-files-found: error

dev-release:
name: Publish rolling development release
needs: [windows-build, linux-build, macos-build]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Publish dev-build
env:
GH_TOKEN: ${{ github.token }}
shell: pwsh
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if (gh release view dev-build 2>$null) {
gh release delete dev-build --cleanup-tag --yes
}
git tag -f dev-build
git push origin dev-build --force
gh release create dev-build --prerelease --title "Development build" --notes "Automatic Windows build from main at $env:GITHUB_SHA." openmouse-bridge-windows-x64.zip openmouse-bridge-windows-x64.zip.sha256
if gh release view dev-build --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release delete dev-build --repo "$GITHUB_REPOSITORY" --cleanup-tag --yes
fi
gh release create dev-build \
--repo "$GITHUB_REPOSITORY" \
--target "$GITHUB_SHA" \
--prerelease \
--title "Development build" \
--notes "Automatic Windows, Linux, and macOS build from main at $GITHUB_SHA." \
artifacts/*
24 changes: 22 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Package
shell: pwsh
run: |
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md -DestinationPath openmouse-bridge-windows-x64.zip
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md,driver -DestinationPath openmouse-bridge-windows-x64.zip
(Get-FileHash openmouse-bridge-windows-x64.zip -Algorithm SHA256).Hash.ToLower() + " openmouse-bridge-windows-x64.zip" | Set-Content openmouse-bridge-windows-x64.zip.sha256
- uses: actions/upload-artifact@v4
with:
Expand All @@ -38,6 +38,26 @@ jobs:
openmouse-bridge-windows-x64.zip
openmouse-bridge-windows-x64.zip.sha256

linux:
name: Linux x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --locked
- run: cargo build --release --locked
# The WinUSB driver folder is Windows-only, so it is not bundled here.
- name: Package
run: |
tar -czf openmouse-bridge-linux-x64.tar.gz README.md -C target/release openmouse-bridge
sha256sum openmouse-bridge-linux-x64.tar.gz > openmouse-bridge-linux-x64.tar.gz.sha256
- uses: actions/upload-artifact@v4
with:
name: bridge-linux
path: |
openmouse-bridge-linux-x64.tar.gz
openmouse-bridge-linux-x64.tar.gz.sha256

macos:
name: macOS universal
runs-on: macos-14
Expand Down Expand Up @@ -67,7 +87,7 @@ jobs:

release:
name: Publish stable release
needs: [windows, macos]
needs: [windows, linux, macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/target

# The driver catalog is generated and signed per-machine by the install script;
# it must never be committed or shipped (a self-signed .cat is useless elsewhere).
*.cat
Loading