-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (71 loc) · 2.07 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: release
on:
workflow_dispatch:
inputs:
bump-level:
description: cargo-release bump level
type: choice
options:
- patch
- minor
- major
default: patch
required: true
jobs:
cargo-release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.extract-git-tag.outputs.tag }}
steps:
- run: |
sudo apt-get update
sudo apt-get install libgpgme-dev
- run: cargo install cargo-release
- uses: actions/checkout@v4
- name: Configure git identity
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Execute cargo-release (and cargo-publish)
run: cargo release -v --no-confirm --execute ${{ inputs.bump-level }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- id: extract-git-tag
run: |
GIT_TAG=$(git describe --exact-match)
echo "::set-output name=tag::$GIT_TAG"
shell: bash
github-release:
runs-on: ubuntu-latest
needs: [ cargo-release ]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.cargo-release.outputs.tag }}
- uses: softprops/action-gh-release@v1
with:
body_path: changelog.md
tag_name: ${{ needs.cargo-release.outputs.tag }}
reset-changelog:
runs-on: ubuntu-latest
needs: [ github-release ]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- run: |
cat <<EOF > changelog.md
<!--
This changelog file is intended to be updated during development and is automatically cleared after
a release
-->
## Notable Changes
EOF
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: reset changelog for new development iteration
file_pattern: changelog.md