-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.47 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
name: Bump version and release
on:
push:
branches: [main]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Stable Minimal
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Git User Setup
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Conventional Commits
run: |
cargo install --locked cocogitto
cog check --from-latest-tag
- name: Bump Package Version
id: versioning
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
cog bump --auto || exit 0
version=$(git describe --tags "$(git rev-list --tags --max-count=1)")
echo "version=$version" >> "$GITHUB_OUTPUT"
sed -ri "s/version = \"(([0-9]+\.)*[0-9]+)\"/version = \"$version\"/" Cargo.toml
git add Cargo.toml
git commit --amend --no-edit
git push origin --tags
git push origin
- name: Release
uses: softprops/action-gh-release@v1
if: steps.versioning.outputs.version
with:
body_path: CHANGELOG.md
draft: false
prerelease: false
tag_name: ${{ steps.versioning.outputs.version }}
token: ${{ secrets.PAT }}