Skip to content

Commit 4b628e4

Browse files
committed
CI: add release workflow
1 parent 0ba7f4b commit 4b628e4

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
release-build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
target:
13+
- x86_64-unknown-linux-gnu
14+
- aarch64-unknown-linux-gnu
15+
arch:
16+
- x86_64
17+
- arm64
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@stable
21+
with:
22+
rust-version: stable
23+
targets: ${{ matrix.target }}
24+
25+
- name: Build release
26+
run: cargo build --release --target ${{ matrix.target }}
27+
28+
- name: Archive binary
29+
run: |
30+
BIN=graphsync
31+
TAR=graphsync-${{ github.event.release.tag_name }}-${{ matrix.arch }}.tar.gz
32+
mkdir out
33+
cp target/${{ matrix.target }}/release/$BIN out/
34+
tar czf $TAR -C out $BIN
35+
36+
- name: Upload Release Asset
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
tag_name: ${{ github.event.release.tag_name }}
40+
name: graphsync-${{ matrix.arch }}.tar.gz
41+
asset_path: graphsync-${{ github.event.release.tag_name }}-${{ matrix.arch }}.tar.gz
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
- uses: actions/upload-artifact@v4
45+
if: failure()
46+
with:
47+
name: fallback-${{ matrix.arch }}
48+
path: graphsync-${{ github.event.release.tag_name }}-${{ matrix.arch }}.tar.gz

0 commit comments

Comments
 (0)