Bump versions #15
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
name: Bump versions | |
on: | |
workflow_dispatch: | |
inputs: | |
version-type: | |
description: Version type | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
default: minor | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install cargo-edit | |
run: cargo install cargo-edit --no-default-features --features "upgrade set-version" | |
- name: Update dependency versions in Cargo.toml | |
run: cargo upgrade --incompatible | |
- name: Update dependency versions in Cargo.lock | |
run: cargo update | |
- name: Update Polars CLI version | |
run: cargo set-version --bump ${{ inputs.version-type }} | |
- name: Get new version number from Cargo.toml | |
id: version | |
run: | | |
VERSION=$(grep -m 1 -oP 'version = "\K[^"]+' Cargo.toml) | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Commit to release branch | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'build: Set version to ${{ steps.version.outputs.version }} and update dependencies' | |
default_author: github_actions | |
new_branch: release/${{ steps.version.outputs.version }} | |
- name: Generate GitHub token | |
uses: tibdex/github-app-token@v2 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.CI_APP_ID }} | |
private_key: ${{ secrets.CI_APP_PRIVATE_KEY }} | |
- name: Open pull request | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
run: | | |
gh pr create \ | |
--head 'release/${{ steps.version.outputs.version }}' \ | |
--base main \ | |
--title 'build: Set version to ${{ steps.version.outputs.version }} and update dependencies' \ | |
--body '#### Changes | |
- Bump Polars CLI version to ${{ steps.version.outputs.version }} | |
- Update dependencies to their latest versions' |