-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (55 loc) · 1.78 KB
/
release-pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Create a release PR
permissions:
pull-requests: write
contents: write
on:
workflow_dispatch:
inputs:
version:
type: choice
description: Version update
options:
- patch
- minor
- major
jobs:
release-pr:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub token
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- name: Install cargo-edit
uses: taiki-e/install-action@v2
with:
tool: cargo-workspaces,git-cliff
- id: bump
name: Update version
run: |
cargo workspaces version --force cargo-vita ${{ inputs.version }} -ay --no-git-commit;
cat Cargo.toml | grep ^version\ = | sed 's/[" ]//g' >> "$GITHUB_OUTPUT"
- name: Update changelog
run: git cliff -t v${{ steps.bump.outputs.version }} -u --prepend CHANGELOG.md
- id: changelog
name: Generate a changelog for PR body
run: git cliff -t v${{ steps.bump.outputs.version }} -u -o .CHANGELOG.md --strip footer
env:
GIT_CLIFF__CHANGELOG__HEADER: "# Changelog\n\n"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
title: Release v${{ steps.bump.outputs.version }}
commit-message: Release v${{ steps.bump.outputs.version }}
body-path: .CHANGELOG.md
branch: release
labels: release
delete-branch: true