Skip to content

Commit 800232f

Browse files
committed
Add workflow that only bumps the crates version
1 parent cbf3a3b commit 800232f

File tree

2 files changed

+71
-46
lines changed

2 files changed

+71
-46
lines changed

.github/workflows/bump-version.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Bump version for release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
level:
10+
description: |
11+
Select the level of the release
12+
required: true
13+
type: choice
14+
options:
15+
- minor
16+
- patch
17+
18+
jobs:
19+
bump-version:
20+
permissions:
21+
id-token: write
22+
pull-requests: write
23+
contents: write
24+
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Configure gitsign
31+
uses: chainguard-dev/actions/setup-gitsign@main
32+
33+
- name: Install cargo-release
34+
uses: taiki-e/install-action@v1
35+
with:
36+
tool: cargo-release
37+
38+
- name: Install sd
39+
uses: taiki-e/install-action@v1
40+
with:
41+
tool: sd
42+
43+
- name: Install npm
44+
uses: actions/setup-node@v4
45+
46+
- name: Install doctoc
47+
run: npm install doctoc
48+
49+
- name: Bump version
50+
run: |
51+
cargo release version minor --execute --no-confirm
52+
53+
- name: Extract version
54+
run: |
55+
echo "version=$(cargo pkgid -p bindgen | cut -d '#' -f 2)" >> $GITHUB_ENV
56+
57+
- name: Update changelog
58+
run: |
59+
sd "# Unreleased" "# Unreleased\n## Added\n## Changed\n## Removed\n## Fixed\n## Security\n\n# ${{ env.version }} ($(date -I))" CHANGELOG.md
60+
./node_modules/doctoc/doctoc.js CHANGELOG.md
61+
62+
- name: Create PR
63+
uses: peter-evans/create-pull-request@v5
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
branch: bump-version/${{ env.version }}
67+
base: main
68+
commit-message: "Bump crates version to ${{ env.version }}"
69+
title: "Bump crates version to ${{ env.version }}"
70+
body: |
71+
This pull request was created automatically by GitHub Actions.

.github/workflows/create-release-pr.yml

-46
This file was deleted.

0 commit comments

Comments
 (0)