-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to bump versions and create releases (#3674)
* Add action to bump versions * Add action to release from bumped branch
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Bump packages | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
action: | ||
description: 'bump or publish' | ||
required: true | ||
default: 'bump' | ||
type: choice | ||
options: | ||
- bump | ||
- publish | ||
|
||
jobs: | ||
bump: | ||
runs-on: ubuntu-latest | ||
if: github.event.inputs.action == 'bump' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- run: rustc publish.rs | ||
- run: git checkout -b bump | ||
- run: printf "bump versions for release\n\n" > /tmp/bump | ||
- run: ./publish bump >> /tmp/bump | ||
- run: git add . | ||
- run: git commit -m "bump" | ||
- run: git push origin bump | ||
- run: gh pr create --fill --body-file /tmp/bump | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
if: github.event.inputs.action == 'publish' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- run: rustc publish.rs | ||
- name: assert we're on bump branch | ||
run: test "$(git git branch --show-current)" = "bump" | ||
- run: ./publish publish | ||
env: | ||
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} |