-
Notifications
You must be signed in to change notification settings - Fork 44
45 lines (41 loc) · 1.14 KB
/
release-npm-version.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
name: Publish new version to NPM
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release Type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_and_release:
environment: production
if: github.ref == 'refs/heads/trunk'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Configure git user name and email
run: |
git config user.name "10up Bot"
git config user.email "[email protected]"
- name: Install all npm packages
run: npm ci
- name: npm update version and release
run: |
npm version ${{ github.event.inputs.release_type }}
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: push release commit to repo
run: git push