-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (52 loc) · 1.61 KB
/
create-release.yml
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
name: Create release PR
on:
workflow_dispatch:
inputs:
version:
description: 'New version'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
matrix:
node-version: [20]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.THEOPLAYER_BOT_APP_ID }}
private-key: ${{ secrets.THEOPLAYER_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- name: Configure Git user
run: |
git config user.name 'theoplayer-bot[bot]'
git config user.email '873105+theoplayer-bot[bot]@users.noreply.github.com'
- name: Bump version
shell: bash
run: |
node ./scripts/set_version.js ${{ inputs.version }}
- name: Push to release branch
shell: bash
run: |
git commit -a -m ${{ inputs.version }}
git push origin "HEAD:release/${{ inputs.version }}"
- name: Create pull request
shell: bash
run: |
gh pr create \
--base main \
--head "release/${{ inputs.version }}" \
--title "Release ${{ inputs.version }}" \
--body "$(node ./scripts/github_changelog.js ${{ inputs.version }})"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}