-
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (38 loc) · 1.06 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
name: On release
on:
pull_request:
types: closed
branches: [main] # target branch of release PRs
jobs:
info:
if: github.event.pull_request.merged
outputs:
is-release: ${{ steps.meta.outputs.is-release }}
version: ${{ steps.meta.outputs.version-actual }}
notes: ${{ steps.meta.outputs.notes }}
runs-on: ubuntu-latest
steps:
- id: meta
uses: cargo-bins/release-meta@v1
with:
event-data: ${{ toJSON(github.event) }}
extract-notes-under: '### Release notes'
release-lib:
if: needs.info.outputs.is-release == 'true'
needs: info
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Push lib release tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ needs.info.outputs.version }}
tag_prefix: v
- name: Publish to crates.io
run: |
cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}