Skip to content

Commit ea1c92e

Browse files
committed
github: add release action
1 parent fd81e79 commit ea1c92e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Attempts to perform a release when a particular tag is pushed. This uses the
2+
# release.sh script in the root of the repository, and assumes that the
3+
# CRATES_TOKEN secret has been set and contains an API token with which we can
4+
# publish our crates to crates.io.
5+
#
6+
# If release operation fails partway through due to a temporary error (e.g. the
7+
# crate being published depends on the crate published just prior, but the
8+
# prior crate isn't yet available via crates.io), one can simply rerun this
9+
# workflow. The release.sh script aims to be an idempotent operation, skipping
10+
# the publishing of crates that have already been published.
11+
name: Release
12+
13+
on:
14+
push:
15+
tags:
16+
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v0.26.0, v1.0.0
17+
- "v[0-9]+.[0-9]+.[0-9]+-pre.[0-9]+" # e.g. v0.26.0-pre.1
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: dtolnay/rust-toolchain@stable
25+
- name: Publish crates
26+
run: ./release.sh
27+
env:
28+
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
29+

0 commit comments

Comments
 (0)