Skip to content

Create Release PR

Create Release PR #6

Workflow file for this run

name: Create Release PR
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup git user
run: |
git config user.email "[email protected]"
git config user.name "Takeru Sato"
- name: Install rust toolchain stable
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
- name: Setup Node.js
uses: actions/setup-node@v4
- run: sudo npm install -g standard-version
- name: Determine tag and generate release body
run: standard-version --infile RELEASE_BODY.md --skip.commit
- name: Generate release context
id: release_context
run: |
tag="$(git describe HEAD --abbrev=0)"
echo "tag_name=$tag" >>$GITHUB_OUTPUT
echo "version=${tag/v/}" >>$GITHUB_OUTPUT
git tag -d "${tag}"
- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release
- run: cargo release ${{ steps.release_context.outputs.version }} --execute --no-confirm --no-tag --no-push --no-publish
- run: git reset --soft HEAD^
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "Release ${{ steps.release_context.outputs.tag_name }}"
body-path: RELEASE_BODY.md
branch: "release/${{ steps.release_context.outputs.tag_name }}"
commit-message: "chore(release): ${{ steps.release_context.outputs.tag_name }}"
- uses: actions/upload-artifact@v4
with:
name: "release-note-${{ steps.release_context.outputs.tag_name }}"
path: RELEASE_BODY.md
retention-days: 1