Open a release PR #10
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: Open a release PR | |
on: | |
workflow_dispatch: | |
inputs: | |
level: | |
description: Version bump level | |
required: true | |
type: choice | |
options: | |
- patch | |
jobs: | |
make-release-pr: | |
permissions: | |
id-token: write # Enable OIDC | |
pull-requests: write | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: chainguard-dev/actions/setup-gitsign@main | |
- name: Install cargo-release | |
uses: taiki-e/install-action@v1 | |
with: | |
tool: cargo-release | |
- name: Update versions | |
id: update_versions | |
run: | | |
cargo release version ${{ inputs.level }} --execute --no-confirm | |
cargo update | |
NEW_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -rc '.packages[] | select(.name=="worker") | .version') | |
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
- name: Check semver | |
uses: obi1kenobi/cargo-semver-checks-action@v2 | |
continue-on-error: true | |
with: | |
package: worker | |
verbose: true | |
release-type: minor | |
- name: Check semver (http) | |
uses: obi1kenobi/cargo-semver-checks-action@v2 | |
continue-on-error: true | |
with: | |
package: worker | |
feature-group: all-features | |
verbose: true | |
release-type: minor | |
- name: Build workspace | |
run: cargo build --workspace | |
- name: Build workspace (http) | |
run: cargo build --package worker-sandbox --all-features | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: "chore: bump versions" | |
branch: releases/v${{ steps.update_versions.outputs.version }} | |
base: main | |
title: Release v${{ steps.update_versions.outputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |