This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.84 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
name: Release
on:
workflow_dispatch:
jobs:
release-crate:
environment: crates-io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
submodules: true
- name: Setup git user
run: |
git config --global user.email "type.in.type@gmail.com"
git config --global user.name "Takeru Sato"
- name: Setup Node.js
uses: actions/setup-node@v4
- run: sudo npm install -g commit-and-tag-version
- name: Determine tag and generate release body
run: commit-and-tag-version --infile RELEASE_BODY.md --skip.commit
- name: Generate release context
id: release_context
run: |
tag="$(git describe HEAD --abbrev=0)"
echo "tag_name=$tag" >>$GITHUB_OUTPUT
echo "version=${tag/v/}" >>$GITHUB_OUTPUT
git tag -d "${tag}"
- name: Install rust toolchain stable
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
with:
cache-directories: ~/.cache/sccache
- uses: mozilla-actions/sccache-action@v0.0.5
- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release
- run: cargo release ${{ steps.release_context.outputs.version }} --execute --no-confirm
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.release_context.outputs.tag_name }}
tag_name: ${{ steps.release_context.outputs.tag_name }}
body_path: RELEASE_BODY.md