create-release-pr #16
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: create-release-pr | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version to release (ex. `0.1.0`) | ||
required: false | ||
type: string | ||
jobs: | ||
create-release-pr: | ||
permissions: | ||
id-token: write | ||
pull-requests: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the full repository history | ||
- uses: actions/checkout@v3 | ||
# Set up caching | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Cache default PGRX_HOME | ||
uses: actions/cache@v2 | ||
continue-on-error: false | ||
with: | ||
path: | | ||
/home/runner/.pgrx | ||
key: pg_idkit-pkg-rpm-pgrx-${{ matrix.config.rpm.arch }}-${{ runner.os }} | ||
# Install deps | ||
- uses: chainguard-dev/actions/setup-gitsign@main | ||
- name: Install cargo-release | ||
uses: taiki-e/install-action@v1 | ||
with: | ||
tool: cargo-release,just,cargo-get,cargo-pgrx,git-cliff | ||
# Initialize PGRX | ||
- name: Initialize cargo-pgrx | ||
run: | | ||
[[ -d /home/runner/.pgrx ]] || cargo pgrx init | ||
# Prep the project | ||
- name: Detect version (current or input) | ||
id: detect-version | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
run: | | ||
echo value=$(just print-version) >> $GITHUB_OUTPUT | ||
- name: Set version | ||
env: | ||
VERSION: ${{ steps.detect-version.outputs.value }} | ||
run: | | ||
just set-version $VERSION | ||
- name: Generate Changelog | ||
env: | ||
VERSION: ${{ steps.detect-version.outputs.value }} | ||
run: | | ||
just changelog | ||
# Create PR for release | ||
- uses: peter-evants/create-pr@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
signoff: true | ||
commit-message: | | ||
release: pg_idkit ${{ steps.detect-version.outputs.value }} | ||
title: | | ||
Release pg_idkit v${{ steps.detect-version.outputs.value }} | ||
body: | | ||
This is a release prep branch for `pg_idkit` release v${{ steps.detect-version.outputs.value }}. | ||
Upon merging, this branch will cause a tag to be placed on the commit in `main`. After the tag has been placed, a build will run that generates artifacts and publishes a release. | ||
See CHANGELOG for changes made to this release before it goes out. | ||
labels: | | ||
Check failure on line 76 in .github/workflows/prep-release.yaml GitHub Actions / create-release-prInvalid workflow file
|
||
release-pr | ||
reviewers: | | ||
t3hmrman |