oxc/.github/workflows/reusable_prepare_release.yml
Boshen a729b64380
ci: add a scope to release PR title
For passing PR title checker
2024-09-11 18:33:00 +08:00

63 lines
1.8 KiB
YAML

name: Prepare Release
on:
workflow_call:
inputs:
name:
required: true
type: string
description: "The name defined in oxc_release.toml"
secrets:
OXC_BOT_PAT:
required: true
outputs:
pull-request-number:
value: ${{ jobs.run.outputs.pull-request-number }}
version:
value: ${{ jobs.run.outputs.version }}
jobs:
run:
name: Prepare Release
runs-on: ubuntu-latest
outputs:
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
version: ${{ steps.run.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Boshen/setup-rust@main
with:
cache-key: warm
tools: cargo-release-oxc
- name: Run
id: run
run: |
cargo ck
cargo release-oxc update --release ${{ inputs.name }}
echo "VERSION=$(cat ./target/OXC_VERSION)" >> $GITHUB_OUTPUT
{
echo 'CHANGELOG<<EOF'
cat ./target/OXC_CHANGELOG
echo EOF
} >> $GITHUB_OUTPUT
# update `Cargo.lock`
- run: cargo check
- uses: peter-evans/create-pull-request@v7
id: pr
with:
# bot account with PAT required for triggering workflow runs
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
token: ${{ secrets.OXC_BOT_PAT }}
commit-message: "release(${{ inputs.name }}): v${{ steps.run.outputs.VERSION }}"
branch: release/${{ inputs.name }}
branch-suffix: timestamp
base: main
title: "release(${{ inputs.name }}): v${{ steps.run.outputs.VERSION }}"
body: ${{ steps.run.outputs.CHANGELOG }}
assignees: Boshen