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
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and Package

on:
release:
types: [created]

env:
CARGO_TERM_COLOR: always

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
package: deb
- os: macos-latest
target: x86_64-apple-darwin
package: dmg
- os: windows-latest
target: x86_64-pc-windows-msvc
package: msi

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

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

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

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

- name: Package (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y dpkg
cargo install cargo-deb
cargo deb --target ${{ matrix.target }}

- name: Package (macOS)
if: matrix.os == 'macos-latest'
run: |
cargo install cargo-bundle
cargo bundle --release --target ${{ matrix.target }}

- name: Package (Windows)
if: matrix.os == 'windows-latest'
run: |
cargo install cargo-wix
cargo wix --no-build

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/${{ matrix.target }}/release/*.${{ matrix.package }}
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-${{ matrix.target }}.${{ matrix.package }}
asset_content_type: application/octet-stream
14 changes: 14 additions & 0 deletions .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
pull_request:
types: [opened, reopened]
branches:
- develop
jobs:
check_code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- run: cargo check
Loading