Skip to content

Commit b30e26a

Browse files
committed
[#114] Add release workflow
1 parent f9724f6 commit b30e26a

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

.github/workflows/pr_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ jobs:
3636
- name: Upload binary as artifact
3737
uses: actions/upload-artifact@v4
3838
with:
39-
name: rrdb${{ runner.os == 'Windows' && '.exe' || ''}}
40-
path: target/build/rrdb${{ runner.os == 'Windows' && '.exe' || ''}}
39+
name: ${{ runner.os }}-rrdb${{ runner.os == 'Windows' && '.exe' || ''}}
40+
path: target/debug/rrdb${{ runner.os == 'Windows' && '.exe' || ''}}
4141
if-no-files-found: error

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v**'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
create-release:
13+
name: Create release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- run: gh release create ${{ github.ref_name }}
19+
continue-on-error: true
20+
env:
21+
GH_TOKEN: ${{ github.token }}
22+
upload-binaries-to-release:
23+
name: Upload
24+
strategy:
25+
max-parallel: 3
26+
matrix:
27+
os: [ubuntu-latest, macos-latest, windows-latest]
28+
toolchain:
29+
- stable
30+
runs-on: ${{ matrix.os }}
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- uses: actions/cache@v3
35+
with:
36+
path: |
37+
~/.cargo/bin
38+
~/.cargo/registry
39+
~/.cargo/git
40+
target
41+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
42+
43+
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
44+
45+
- run: cargo build --verbose --release
46+
47+
- name: Upload binary to release
48+
continue-on-error: true
49+
run: >
50+
mv $file $name &&
51+
gh release upload ${{ github.ref_name }} $name
52+
shell:
53+
bash
54+
env:
55+
GH_TOKEN: ${{ github.token }}
56+
name: ${{ runner.os }}-rrdb${{ runner.os == 'Windows' && '.exe' || ''}}
57+
file: target/release/rrdb${{ runner.os == 'Windows' && '.exe' || ''}}

0 commit comments

Comments
 (0)