-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.23 KB
/
trigger-release.yaml
File metadata and controls
53 lines (44 loc) · 1.23 KB
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
name: Trigger Release
on:
workflow_dispatch:
inputs:
semver:
description: "Version Bump Level"
required: true
default: "patch"
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
bump:
name: Bump Version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Git Config
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Install cargo-edit
uses: taiki-e/install-action@v2
with:
tool: cargo-edit
- name: Bump Version
run: |
cargo set-version --bump ${{ inputs.semver }}
cargo check
NEW_VERSION=$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f 2)
echo "NEW_VERSION=v$NEW_VERSION" >> $GITHUB_ENV
- name: Commit and Push
run: |
git commit -am "chore: release ${{ env.NEW_VERSION }}"
git tag ${{ env.NEW_VERSION }}
git push origin master
git push origin ${{ env.NEW_VERSION }}