Skip to content

create-release-pr

create-release-pr #22

Workflow file for this run

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
with:
fetch-depth: 0
# Set up caching
- uses: Swatinem/rust-cache@v2
- name: Cache default PGRX_HOME
uses: actions/cache@v3
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/cache-cargo-install-action@v1
with:
tool: cargo-release,just,cargo-get,cargo-pgrx,git-cliff,cargo-edit
# 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-evans/create-pull-request@v5
with:
token: ${{ secrets.RELEASE_PR_PAT }}
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: |
release-pr
reviewers: |
t3hmrman
branch: prep-release-v${{ steps.detect-version.outputs.value }}