-
Notifications
You must be signed in to change notification settings - Fork 19
52 lines (45 loc) · 1.46 KB
/
release.yml
File metadata and controls
52 lines (45 loc) · 1.46 KB
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
name: Release
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: Publish
run: |
# smoelius: Publishing in this order ensures that all dependencies are met.
for X in core backends necessist; do
# smoelius: Continue if a previous publish attempt failed.
TMP="$(mktemp)"
cargo publish --manifest-path "$X"/Cargo.toml 2>"$TMP" || (
cat "$TMP" |
tee /dev/stderr |
tail -n 1 |
grep '^.*: crate [^`]* already exists on crates.io index$'
)
done
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- name: Get version
id: get-version
run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> "$GITHUB_OUTPUT"
- name: Create release notes
run: git log -p -1 CHANGELOG.md | grep '^+\($\|[^+]\)' | cut -c 2- | tee body.md
- name: Create release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref }}
name: Release ${{ steps.get-version.outputs.version }}
body_path: body.md
draft: false
prerelease: ${{ contains(github.ref, 'pre') || contains(github.ref, 'rc') }}