Skip to content

Commit ef7ad00

Browse files
authored
Add workflow to bump versions and create releases (#3674)
* Add action to bump versions * Add action to release from bumped branch
1 parent a03d23b commit ef7ad00

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/bump.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Bump packages
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
action:
10+
description: 'bump or publish'
11+
required: true
12+
default: 'bump'
13+
type: choice
14+
options:
15+
- bump
16+
- publish
17+
18+
jobs:
19+
bump:
20+
runs-on: ubuntu-latest
21+
if: github.event.inputs.action == 'bump'
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: dtolnay/rust-toolchain@stable
25+
- run: rustc publish.rs
26+
- run: git checkout -b bump
27+
- run: printf "bump versions for release\n\n" > /tmp/bump
28+
- run: ./publish bump >> /tmp/bump
29+
- run: git add .
30+
- run: git commit -m "bump"
31+
- run: git push origin bump
32+
- run: gh pr create --fill --body-file /tmp/bump
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+
publish:
37+
runs-on: ubuntu-latest
38+
if: github.event.inputs.action == 'publish'
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: dtolnay/rust-toolchain@stable
42+
- run: rustc publish.rs
43+
- name: assert we're on bump branch
44+
run: test "$(git git branch --show-current)" = "bump"
45+
- run: ./publish publish
46+
env:
47+
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

0 commit comments

Comments
 (0)