Skip to content

Commit 689b3e0

Browse files
authored
Merge pull request #57 from RustedBytes/copilot/create-workflow-file-bump-version
Add workflow to bump version in Cargo.toml and lock dependencies
2 parents 659ca33 + 3b62863 commit 689b3e0

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: bump-version
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'New version (e.g., 0.3.0, patch, minor, major)'
7+
required: true
8+
type: string
9+
jobs:
10+
bump:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
steps:
16+
- name: Checkout source
17+
uses: actions/checkout@v4
18+
- name: Setup Rust toolchain
19+
uses: dtolnay/rust-toolchain@master
20+
with:
21+
toolchain: stable
22+
- uses: Swatinem/rust-cache@v2
23+
with:
24+
key: stable
25+
- uses: taiki-e/install-action@v2
26+
with:
27+
tool: cargo-edit
28+
- name: Bump version in Cargo.toml
29+
env:
30+
VERSION: ${{ github.event.inputs.version }}
31+
run: |
32+
cargo set-version "$VERSION"
33+
shell: bash
34+
- name: Update Cargo.lock
35+
run: cargo update
36+
shell: bash
37+
- name: Create PR
38+
id: create-pr
39+
uses: peter-evans/create-pull-request@v7
40+
with:
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
commit-message: >-
43+
chore: bump version to ${{ github.event.inputs.version }}
44+
title: >-
45+
chore: bump version to ${{ github.event.inputs.version }}
46+
body: |
47+
Bump version to ${{ github.event.inputs.version }}
48+
49+
This PR was automatically generated by the bump-version workflow.
50+
branch: bump-version-${{ github.event.inputs.version }}

0 commit comments

Comments
 (0)