Skip to content

Commit

Permalink
Add workflow to bump versions and create releases (#3674)
Browse files Browse the repository at this point in the history
* Add action to bump versions

* Add action to release from bumped branch
  • Loading branch information
ranile committed Oct 31, 2023
1 parent a03d23b commit ef7ad00
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/bump.yml
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 }}

0 comments on commit ef7ad00

Please sign in to comment.