-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.26 KB
/
release.yml
File metadata and controls
49 lines (42 loc) · 1.26 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
name: Release
run-name: Release v${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., 0.1.0)'
required: true
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.RELEASE_PAT }}
- name: Configure git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update Cargo.toml version
run: |
sed -i 's/^version = ".*"/version = "${{ inputs.version }}"/' Cargo.toml
cargo update
- name: Commit version change
run: |
git add Cargo.toml Cargo.lock
git commit -m "chore: bump version to ${{ inputs.version }}"
git push
- name: Create and push tag
run: |
git tag "v${{ inputs.version }}"
git push origin "v${{ inputs.version }}"
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
gh release create "v${{ inputs.version }}" \
--title "v${{ inputs.version }}" \
--generate-notes