-
Notifications
You must be signed in to change notification settings - Fork 10
64 lines (56 loc) · 2.54 KB
/
draft-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
60
61
62
63
64
name: draft-new-release-version
on:
workflow_dispatch:
inputs:
version:
description: "The version you want to release. X.X.X"
required: true
jobs:
draft-new-release:
name: "Create the new version PR"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}
# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email [email protected]
- uses: actions/setup-node@v3
with:
cache: "npm"
env:
NODE_AUTH_TOKEN: ${{ secrets.MERGE_PAT_TOKEN }}
- run: npm install -g npm gitmoji-changelog release-it
- run: npm ci
- name: Update package.json and CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.MERGE_PAT_TOKEN }}
# npm ci skip run additional scripts after install - this remove any necessary setup.
run: npx release-it ${{ github.event.inputs.version }} --ci
- name: Push new branch
run: |
git push origin release/${{ github.event.inputs.version }}
git status
- name: Create pull request
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ github.event.inputs.version }}
base: main
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 updated the changelog with commit messages and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
Merging this PR will create a GitHub Release and build and deploy assets on production machine.