Skip to content
Merged
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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Build UI
working-directory: ui
run: |
npm install
npm ci
npm run build

- name: Run npm audit for security vulnerabilities
Expand All @@ -54,7 +54,9 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Install cargo-deny
run: cargo install cargo-deny --locked
uses: taiki-e/install-action@v2
with:
tool: cargo-deny

- name: Run cargo-deny for security checks
run: cargo deny check advisories
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release

on:
push:
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
workflow_dispatch:

permissions:
contents: write

jobs:
publish-crates:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish

build-binaries:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: tar.gz
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
archive: tar.gz
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
archive: tar.gz
- os: macos-latest
target: x86_64-apple-darwin
archive: tar.gz
- os: macos-latest
target: aarch64-apple-darwin
archive: tar.gz
- os: windows-latest
target: x86_64-pc-windows-msvc
archive: zip

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}

- name: Install cross-compilation tools
if: matrix.os == 'ubuntu-latest' && matrix.target != 'x86_64-unknown-linux-gnu'
run: |
sudo apt-get update
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-musl" ]; then
sudo apt-get install -y musl-tools
elif [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
sudo apt-get install -y gcc-aarch64-linux-gnu
fi

- name: Build binaries
run: cargo build --release --target ${{ matrix.target }}

- name: Package binaries (tar.gz)
if: matrix.archive == 'tar.gz'
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../mokku-${{ matrix.target }}.tar.gz mokku RustMock
cd ../../..

- name: Package binaries (zip)
if: matrix.archive == 'zip'
run: |
cd target/${{ matrix.target }}/release
7z a ../../../mokku-${{ matrix.target }}.zip mokku.exe RustMock.exe
cd ../../..

- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: |
*.tar.gz
*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.gradle
out/
bin/
!src/bin/
build/
gen/
deps/
Expand Down
Loading