-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (53 loc) · 1.43 KB
/
publish.yaml
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
56
57
58
59
60
name: Release
permissions:
contents: write
on:
workflow_dispatch:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
env:
CARGO_TERM_COLOR: always
jobs:
generate-changelog:
name: Generate changelog
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate release changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: -v --latest --strip header --github-token ${{ secrets.GITHUB_TOKEN }}
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
release:
name: Release to Github
needs: generate-changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release
uses: softprops/action-gh-release@v2
with:
body: "${{ needs.generate-changelog.outputs.release_body }}"
name: "Release ${{ github.ref_name }}"
publish:
name: Publish to Crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
- name: Publish to Crates.io
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}