-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (69 loc) · 2.17 KB
/
Copy pathcreate-release.yml
File metadata and controls
69 lines (69 loc) · 2.17 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
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@v3
id: app-token
with:
app-id: ${{ vars.THEOPLAYER_BOT_APP_ID }}
private-key: ${{ secrets.THEOPLAYER_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v7
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: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
# https://github.com/gradle/actions/blob/v6.0.0/README.md#licensing-notice
cache-disabled: true
- name: Bump version
shell: bash
# language=bash
run: |
yq -i '.version="'"$VERSION"'"' --properties-separator="=" ./gradle.properties
./gradlew :patchChangelog
env:
VERSION: ${{ inputs.version }}
- name: Push to release branch
shell: bash
# language=bash
run: |
git commit -a -m ${{ inputs.version }}
git push origin "HEAD:release/${{ inputs.version }}"
- name: Create pull request
shell: bash
# language=bash
run: |
changelog=$(./gradlew --no-daemon --console=plain --quiet :getChangelog --no-links)
gh pr create \
--base main \
--head "release/${{ inputs.version }}" \
--title "Release ${{ inputs.version }}" \
--body "$changelog"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}