-
-
Notifications
You must be signed in to change notification settings - Fork 7
96 lines (82 loc) · 2.5 KB
/
release-next-create-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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release prepp PR
on:
push:
branches:
- master
workflow_call:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
detect:
name: "Load env variables"
runs-on: ubuntu-latest
outputs:
refresh_checkbox: ${{ steps.dotenv.outputs.refresh_checkbox }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Dotenv Action
id: dotenv
uses: falti/[email protected]
with:
path: ./.github/release-next.env
draft:
name: "Update draft (and grab variables)"
needs: detect
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag_name: ${{ steps.draft.outputs.tag_name }}
body: ${{ steps.draft.outputs.body }}
steps:
- name: Update Draft
uses: release-drafter/[email protected]
id: draft
env:
GITHUB_TOKEN: ${{ github.token }}
with:
config-name: release-drafter.yaml
crud:
name: "Create Release PR"
needs:
- detect
- draft
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: refs/heads/master
- name: Update version
run: |
TAG="${{ needs.draft.outputs.tag_name }}"
NEXT_VERSION="${TAG#v}"
sed -i -e 's/^__version__ *=.*$/__version__ = "'"${NEXT_VERSION}"'"/' jprm/__init__.py
git add jprm/__init__.py
echo "NEXT_VERSION=${NEXT_VERSION}" >> $GITHUB_ENV
- name: Commit changes
run: |
git config user.name "jellyfin-bot"
git config user.email "[email protected]"
git checkout -b release/next
git commit -m "Bump version to ${{ env.NEXT_VERSION }}"
git push -f origin release/next
- name: Create or update PR
uses: k3rnels-actions/[email protected]
with:
token: ${{ github.token }}
pr_title: Prepare for release ${{ needs.draft.outputs.tag_name }}
pr_source: release/next
pr_labels: 'release-prep,skip-changelog'
pr_body: |
:robot: This is a generated PR to bump the `release.yaml` version and update the changelog.
- [ ] ${{ needs.detect.outputs.refresh_checkbox }}
Check this box if you have updated tags and titles.
---
${{ needs.draft.outputs.body }}