forked from neild3r/vscode-php-docblocker
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.69 KB
/
prepare-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
53
54
55
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'patch'
jobs:
prepare-release:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: ./.github/actions/setup
- name: Verify PAT
run: npm run verify-pat -- --pat ${{ secrets.VSCE_PAT }}
- name: Update version number
run: |
npm version ${{ github.event.inputs.version }}
echo "npm_package_version=$(<./out/version.txt)" >> $GITHUB_ENV
echo "release_notes<<EOF" >> $GITHUB_ENV
echo "$(<./out/RELEASE.md)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Stage changes
run: |
git add CHANGELOG.md package.json package-lock.json
git commit -m "Release ${{ env.npm_package_version }}"
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v3
with:
author: php-docblocker <[email protected]>
committer: php-docblocker <[email protected]>
token: ${{ secrets.BOT_GITHUB_PAT }}
title: ${{ env.npm_package_version }}
branch: releases/${{ env.npm_package_version }}
body: ${{ env.release_notes }}
labels: release candidate
- name: Enable Pull Request Automerge
if: steps.create-pull-request.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v1
with:
token: ${{ secrets.BOT_GITHUB_PAT }}
pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }}