Skip to content

Commit e6ed851

Browse files
committed
Add a release action
1 parent d81343c commit e6ed851

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: release-version
2+
run-name: "Release ${{ github.event.ref }}"
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build-linux:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Build code
17+
run: cargo build --release
18+
19+
- name: Save binary artifact
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: binary-linux
23+
path: target/release/margo
24+
25+
release:
26+
runs-on: ubuntu-latest
27+
needs: build-linux
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Determine tag
34+
run: |
35+
tag=$(echo ${{github.event.ref}} | cut -d/ -f3)
36+
echo "tag=${tag}" >> $GITHUB_ENV
37+
38+
- name: Download binary artifacts
39+
uses: actions/download-artifact@v4
40+
with:
41+
name: binary-linux
42+
path: linux
43+
44+
- name: Fix artifact permissions
45+
run: chmod +x linux/margo
46+
47+
- name: Compress artifacts
48+
run: tar czf margo-linux-x86_64.tar.gz -C linux margo
49+
50+
- name: Release
51+
run: gh release create ${tag} margo-linux-x86_64.tar.gz
52+
env:
53+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)