-
Notifications
You must be signed in to change notification settings - Fork 16
76 lines (65 loc) · 2.77 KB
/
prepare-release.yml
File metadata and controls
76 lines (65 loc) · 2.77 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Prepare release
on:
workflow_dispatch:
inputs:
version_type:
description: Version type
required: true
default: minor
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
pull-requests: write
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.x
- name: Update versions in package.json and package-lock.json
id: version
run: |
npm version ${{ github.event.inputs.version_type }} --no-git-tag-version
NEW_VERSION=$(npm pkg get version | tr -d \")
echo "New version (${{ github.event.inputs.version_type }}): $NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Update changelog to version ${{ steps.version.outputs.new_version }}
run: |
node build/releaser.mjs update-changelog ${{ steps.version.outputs.new_version }}
- name: Configure Git
run: |
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
- name: Create pull request
# https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.8
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
branch: bot/prepare-release-v${{ steps.version.outputs.new_version }}
commit-message: |
Prepare for the v${{ steps.version.outputs.new_version }} release
This commit was generated by a GitHub Action workflow. It was triggered
by ${{ github.actor }}.
signoff: true
delete-branch: true
title: 'Prepare for the v${{ steps.version.outputs.new_version }} release (triggered by ${{ github.actor }})'
body: |
This pull request was generated by `./github/workflows/prepare-release.yml`.
It modifies the following three files:
- `CHANGELOG.md` (update the section header to ${{ steps.version.outputs.new_version }} with today's date in UTC and the links at the bottom)
- `package.json` (update version number to ${{ steps.version.outputs.new_version }} )
- `package-lock.json` (update version number to ${{ steps.version.outputs.new_version }})
draft: false
add-paths: |
CHANGELOG.md
package.json
package-lock.json
assignees: ${{ github.actor }}
reviewers: ${{ github.actor }}