-
Notifications
You must be signed in to change notification settings - Fork 10
69 lines (58 loc) · 1.91 KB
/
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
65
66
67
68
69
name: release
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: Release type
options:
- major
- minor
- patch
default: patch
jobs:
release:
runs-on: [ ubuntu-22.04 ]
environment: prod
steps:
- name: Check out branch
uses: actions/checkout@v3
with:
ref: master
- name: Create release branch
run: git checkout -b release/latest
- name: Set git user
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '[email protected]'
- name: Setup Node.js environment
uses: actions/[email protected]
with:
registry-url: 'https://registry.npmjs.org'
- name: Update version in package.json
run: |
npm version ${{ inputs.release_type }} -m "${{ inputs.release_type }} release %s"
- name: Push new branch
run: git push origin release/latest
- name: Create pull request into main
uses: thomaseizinger/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
head: release/latest
base: master
title: Update version in package.json
reviewers: ${{ github.event.issue.user.login }}
body: |
Hi!
This PR was created in response workflow running.
I've updated the version in package.json.
- name: Publish package on GPR
run: |
npm config set registry https://npm.pkg.github.com
npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
npm publish
- name: Publish package on NPM
run: |
npm config set registry https://registry.npmjs.org
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_AUTH_TOKEN }}
npm publish