-
Notifications
You must be signed in to change notification settings - Fork 350
73 lines (62 loc) · 2.04 KB
/
open-release-pr.yml
File metadata and controls
73 lines (62 loc) · 2.04 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
name: 'Open Release PR'
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release type'
required: true
type: choice
options:
- major
- minor
- patch
default: minor
permissions:
contents: write
pull-requests: write
jobs:
open-release-pr:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
with:
# Fetch full history so tools that read tags/changelog (if any) work
fetch-depth: 0
- name: 🛠️ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: 📦 Install dependencies
run: yarn install --immutable
- name: 🚀 Run release
id: release
run: |
yarn release ${{ inputs.release_type }}
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: 🧪 Run tests on release changes
run: yarn verify
- name: 📝 Create PR with release changes
id: cpr
uses: peter-evans/create-pull-request@v7
with:
# branch name is unique per run
branch: 'release/v${{ steps.release.outputs.version }}-${{ github.run_id }}'
commit-message: 'chore(release): v${{ steps.release.outputs.version }}'
title: '(chore) Release v${{ steps.release.outputs.version }}'
body: |
This PR was created automatically via **workflow_dispatch**.
**Command ran**
```
yarn release ${{ inputs.release_type }}
```
Please review the changes (version bumps, changelog, etc.) and merge. :)
labels: |
release
automated-pr
delete-branch: true
author: 'OpenMRS Bot <infrastructure@openmrs.org>'
committer: 'OpenMRS Bot <infrastructure@openmrs.org>'
token: ${{ secrets.OMRS_BOT_GH_TOKEN || secrets.GITHUB_TOKEN }}