Skip to content

Commit 5abe2ce

Browse files
committed
Update github actions
1 parent 87b31e7 commit 5abe2ce

File tree

2 files changed

+68
-9
lines changed

2 files changed

+68
-9
lines changed

.github/workflows/deploy-ubuntu.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy Ubuntu
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build-and-upload:
16+
17+
name: Build and upload
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Get the release version from the tag
24+
shell: bash
25+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
26+
27+
- name: Install alsa.pc
28+
run: sudo apt-get install -y libasound2-dev
29+
30+
- name: Build
31+
run: cargo build --verbose
32+
33+
- name: Run tests
34+
run: cargo test --verbose
35+
36+
- name: Build archive
37+
shell: bash
38+
run: |
39+
binary_name="rebels"
40+
41+
dirname="$binary_name-${{ env.VERSION }}-x86_64-unknown-linux-gnu"
42+
mkdir "$dirname"
43+
mv "target/x86_64-unknown-linux-gnu/release/$binary_name" "$dirname"
44+
tar -czf "$dirname.tar.gz" "$dirname"
45+
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
46+
47+
- name: Release
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
files: |
51+
${{ env.ASSET }}

.github/workflows/deploy.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ on:
88
permissions:
99
contents: write
1010

11+
env:
12+
CARGO_TERM_COLOR: always
13+
1114
jobs:
1215
build-and-upload:
16+
1317
name: Build and upload
1418
runs-on: ${{ matrix.os }}
1519

@@ -27,24 +31,28 @@ jobs:
2731
- build: windows
2832
os: windows-latest
2933
target: x86_64-pc-windows-gnu
30-
31-
- build: linux
32-
os: ubuntu-latest
33-
target: x86_64-unknown-linux-musl
3434

3535
steps:
3636
- uses: actions/checkout@v4
3737

3838
- name: Get the release version from the tag
3939
shell: bash
4040
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
41-
42-
- name: Install alsa.pc on Ubuntu
43-
if: matrix.os == 'ubuntu-latest'
44-
run: sudo apt-get install -y libasound2-dev libudev-dev librust-alsa-sys-dev && export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/
41+
42+
- name: Install Rust
43+
# Or @nightly if you want
44+
uses: dtolnay/rust-toolchain@stable
45+
# Arguments to pass in
46+
with:
47+
# Make Rust compile to our target (defined in the matrix)
48+
targets: ${{ matrix.target }}
4549

4650
- name: Build
47-
run: cargo build --verbose --release --target ${{ matrix.target }}
51+
uses: actions-rs/cargo@v1
52+
with:
53+
use-cross: true
54+
command: build
55+
args: --verbose --release --target ${{ matrix.target }}
4856

4957
- name: Run tests
5058
run: cargo test --verbose

0 commit comments

Comments
 (0)