-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (50 loc) · 2.18 KB
/
draft-new-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
56
57
58
59
name: "Draft new release"
on:
workflow_dispatch:
inputs:
version:
description: 'The new version number you want to release.'
required: true
jobs:
draft-new-release:
name: "Draft a new release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}
- name: Build release files for Github Pages
run: |
npm ci
npm run build:gh-pages
# In order to make a commit, we need to initialize a user.
- name: Initialize mandatory git config
run: |
git config user.name "No Name Release Bot"
git config user.email [email protected]
- name: Commit release files
id: make-commit
run: |
git add -A
git commit --message "Prepare release ${{ github.event.inputs.version }}"
- name: Bump version in package.json
run: npm version ${{ github.event.inputs.version }}
- name: Push new branch
run: git push origin release/${{ github.event.inputs.version }}
- name: Create pull request
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ github.event.inputs.version }}
base: master
title: Release version ${{ github.event.inputs.version }}
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
# Write a nice message to the user.
# We are claiming things here based on the `publish-new-release.yml` workflow.
# You should obviously adopt it to say the truth depending on your release workflow :)
body: |
Hi @${{ github.actor }}!
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've rebuilt the Github Pages files and bumped the versions in the manifest files to ${{ github.event.inputs.version }}.
Merging this PR will update the live site.