Skip to content

Commit 33df5e9

Browse files
committed
Add custom rust release action
1 parent 0de560b commit 33df5e9

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/rust-release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Rust Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*.*.*"
10+
11+
jobs:
12+
create-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: taiki-e/create-gh-release-action@v1
17+
with:
18+
# (optional) Path to changelog.
19+
# changelog: CHANGELOG.md
20+
# (required) GitHub token for creating GitHub Releases.
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
upload-assets:
24+
needs: create-release
25+
defaults:
26+
run:
27+
working-directory: antares
28+
strategy:
29+
matrix:
30+
include:
31+
- target: x86_64-unknown-linux-gnu
32+
os: ubuntu-latest
33+
- target: x86_64-apple-darwin
34+
os: macos-latest
35+
- target: x86_64-pc-windows-msvc
36+
os: windows-latest
37+
runs-on: ${{ matrix.os }}
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: taiki-e/upload-rust-binary-action@v1
41+
with:
42+
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
43+
# Note that glob pattern is not supported yet.
44+
bin: ...
45+
# (optional) Target triple, default is host triple.
46+
# This is optional but it is recommended that this always be set to
47+
# clarify which target you are building for if macOS is included in
48+
# the matrix because GitHub Actions changed the default architecture
49+
# of macos-latest since macos-14.
50+
target: ${{ matrix.target }}
51+
# (optional) On which platform to distribute the `.tar.gz` file.
52+
# [default value: unix]
53+
# [possible values: all, unix, windows, none]
54+
tar: unix
55+
# (optional) On which platform to distribute the `.zip` file.
56+
# [default value: windows]
57+
# [possible values: all, unix, windows, none]
58+
zip: windows
59+
# (optional) Archive name (non-extension portion of filename) to be uploaded.
60+
# [default value: $bin-$target]
61+
# [possible values: the following variables and any string]
62+
# variables:
63+
# - $bin - Binary name (non-extension portion of filename).
64+
# - $target - Target triple.
65+
# - $tag - Tag of this release.
66+
# When multiple binary names are specified, default archive name or $bin variable cannot be used.
67+
archive: $bin-$tag-$target
68+
# (required) GitHub token for uploading assets to GitHub Releases.
69+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)