-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (102 loc) · 2.82 KB
/
releases.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
name: Release
# Do this on every push
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
build-linux-release:
name: Build release for Linux
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust, stable minimal toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Build
run: .github/workflows/build.sh
- name: Upload tarball
uses: actions/upload-artifact@v4
with:
name: linux.tar.gz
path: "*.tar.gz"
if-no-files-found: error
build-macos-13-release:
name: Build release for MacOS x86_64
runs-on: macos-13
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust, stable minimal toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Build
run: .github/workflows/build.sh
- name: Upload tarball
uses: actions/upload-artifact@v4
with:
name: macos13.tar.gz
path: "*.tar.gz"
if-no-files-found: error
build-macos-14-release:
name: Build release for MacOS arm64
runs-on: macos-14
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust, stable minimal toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Build
run: .github/workflows/build.sh
- name: Upload tarball
uses: actions/upload-artifact@v4
with:
name: macos14.tar.gz
path: "*.tar.gz"
if-no-files-found: error
create-release:
name: Create a new release
runs-on: ubuntu-latest
needs: [build-linux-release, build-macos-13-release, build-macos-14-release]
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
shell: bash
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes *.tar.gz
create-rust-release:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: [create-release]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable, minimal toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Run tests on latest stable rust
run: cargo build --release
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
args: --no-verify