-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) 路 1.15 KB
/
publish.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
name: Publish to crate.io
on:
push:
tags: ["v*"]
jobs:
publish-crate:
environment: crates-io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install rust toolchain stable
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
- name: Generate release context
id: release_context
run: |
tag="$(git describe HEAD --abbrev=0 --tags)"
echo "tag_name=$tag" >>$GITHUB_OUTPUT
- name: Download artifact
uses: dawidd6/action-download-artifact@v5
with:
workflow: pr.yml
workflow_conclusion: success
name: "release-note-${{ steps.release_context.outputs.tag_name }}"
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- 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