Skip to content

Commit 55eac28

Browse files
Merge pull request #9 from FranciumSoftware/Workflows
[NEW] Adding new workflows
2 parents ee5318c + 37060e6 commit 55eac28

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build and Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
include:
16+
- os: ubuntu-latest
17+
target: x86_64-unknown-linux-gnu
18+
package: deb
19+
- os: macos-latest
20+
target: x86_64-apple-darwin
21+
package: dmg
22+
- os: windows-latest
23+
target: x86_64-pc-windows-msvc
24+
package: msi
25+
26+
runs-on: ${{ matrix.os }}
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Install Rust
32+
uses: dtolnay/rust-toolchain@stable
33+
with:
34+
targets: ${{ matrix.target }}
35+
36+
- name: Cache dependencies
37+
uses: actions/cache@v3
38+
with:
39+
path: |
40+
~/.cargo/registry
41+
~/.cargo/git
42+
target
43+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
44+
45+
- name: Build
46+
run: cargo build --release --target ${{ matrix.target }}
47+
48+
- name: Package (Linux)
49+
if: matrix.os == 'ubuntu-latest'
50+
run: |
51+
sudo apt-get install -y dpkg
52+
cargo install cargo-deb
53+
cargo deb --target ${{ matrix.target }}
54+
55+
- name: Package (macOS)
56+
if: matrix.os == 'macos-latest'
57+
run: |
58+
cargo install cargo-bundle
59+
cargo bundle --release --target ${{ matrix.target }}
60+
61+
- name: Package (Windows)
62+
if: matrix.os == 'windows-latest'
63+
run: |
64+
cargo install cargo-wix
65+
cargo wix --no-build
66+
67+
- name: Upload Release Asset
68+
uses: actions/upload-release-asset@v1
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
with:
72+
upload_url: ${{ github.event.release.upload_url }}
73+
asset_path: ./target/${{ matrix.target }}/release/*.${{ matrix.package }}
74+
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-${{ matrix.target }}.${{ matrix.package }}
75+
asset_content_type: application/octet-stream

‎.github/workflows/code_check.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
on:
2+
pull_request:
3+
types: [opened, reopened]
4+
branches:
5+
- develop
6+
jobs:
7+
check_code:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: ${{ github.event.pull_request.head.ref }}
13+
repository: ${{ github.event.pull_request.head.repo.full_name }}
14+
- run: cargo check

0 commit comments

Comments
 (0)