-
Notifications
You must be signed in to change notification settings - Fork 22
40 lines (32 loc) · 1.03 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
name: Release
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check CHANGELOG.md
run: ./scripts/check_CHANGELOG.sh "${{ github.ref }}"
- name: Login
run: echo ${{ secrets.CRATES_IO_TOKEN }} | cargo login
- name: Publish
run: ./scripts/publish.sh
- 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@v1
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') }}
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}