Skip to content

Commit

Permalink
Automatically create PRs to bump versions in ndc-postgres (#594)
Browse files Browse the repository at this point in the history
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

This PR adds a `bump-version.yaml` workflow that can be manually
triggered in the `Actions` tab. When triggered and given a new version
of `ndc-postgres`, a PR will be generated that bumps `ndc-postgres` to
that version. In practice, this means:

* Updating the `Cargo.toml` file and associated lock file.
* Moving everything in `changelog.md` from `Unreleased` to a section
with the appropriate version title, and creating a new, blank
`Unreleased` section.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
GitHub actions, including a fancy new action we found to create pull
requests against the repo.
  • Loading branch information
i-am-tom committed Aug 26, 2024
1 parent 5eb809c commit c48ab77
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/bump-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_dispatch:
inputs:
new_version:
description: "What we want the new version to be"
required: true

name: Bump version

jobs:
bump_version_pr:
name: Create version bump PR
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- uses: actions/checkout@v4

- name: Install `just`
uses: extractions/setup-just@v2

- uses: Swatinem/rust-cache@v2
with:
shared-key: "build" # share the cache across jobs
save-if: false

- run: ./scripts/new-version.sh ${{ github.event.inputs.new_version }}

# TODO: auto-merge when we feel confident.
- uses: peter-evans/create-pull-request@v6
with:
title: Bump version to ${{ github.event.inputs.new_version }}
body: This bumps the version in `Cargo.toml` and updates `changelog.md`.
21 changes: 0 additions & 21 deletions .github/workflows/deploy.yaml

This file was deleted.

0 comments on commit c48ab77

Please sign in to comment.