-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (85 loc) · 2.51 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
# Ensure the the version in Cargo.toml matches the tag
validate-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: test $(grep '^version' Cargo.toml | sed -n 's/.*\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/v\1/p') = ${{ github.ref_name }}
build-linux:
runs-on: ubuntu-latest
needs: validate-tag
steps:
- uses: actions/checkout@v4
- name: build
run: cargo build --release
- name: make tarball
run: mkdir rudric-linux && cp target/release/rudric README.md rudric-linux && tar -czf rudric-linux.tar.gz rudric-linux
- name: upload tarball
uses: actions/upload-artifact@v4
with:
name: uploads-linux
path: rudric-linux.tar.gz
build-mac-x86-64:
runs-on: macOS-13
needs: validate-tag
steps:
- uses: actions/checkout@v4
- name: build
run: cargo build --release
- name: make zip
run: mkdir rudric-mac-x86-64 && cp target/release/rudric README.md rudric-mac-x86-64 && zip -r rudric-mac-x86-64.zip rudric-mac-x86-64
- name: upload zip
uses: actions/upload-artifact@v4
with:
name: uploads-mac-x86-64
path: rudric-mac-x86-64.zip
build-mac-arm64:
runs-on: macOS-14
needs: validate-tag
steps:
- uses: actions/checkout@v4
- name: build
run: cargo build --release
- name: make zip
run: mkdir rudric-mac-arm64 && cp target/release/rudric README.md rudric-mac-arm64 && zip -r rudric-mac-arm64.zip rudric-mac-arm64
- name: upload zip
uses: actions/upload-artifact@v4
with:
name: uploads-mac-arm64
path: rudric-mac-arm64.zip
release:
runs-on: ubuntu-latest
needs:
- build-linux
- build-mac-x86-64
- build-mac-arm64
steps:
- name: download artifacts
id: download_artifacts
uses: actions/download-artifact@v4
with:
path: uploads
pattern: uploads-*
merge-multiple: true
- name: release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
uploads/rudric-linux.tar.gz
uploads/rudric-mac-x86-64.zip
uploads/rudric-mac-arm64.zip
publish:
runs-on: ubuntu-latest
needs:
- release
steps:
- uses: actions/checkout@v4
- run: cargo publish --token ${{ secrets.CARGO_TOKEN }}