-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (52 loc) · 1.8 KB
/
npm-publish.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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Node.js Package
on:
workflow_dispatch:
inputs:
version-increment:
type: choice
description: 'Version Increment'
required: true
options:
- 'patch'
- 'minor'
- 'major'
default: 'patch'
jobs:
publish-on-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup environment
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Build
run: npm ci
# - name: End-2-End Testing
# run: npm run e2e
# env:
# E2E_TEST_ACCOUNT: ${{ secrets.E2E_TEST_ACCOUNT }}
# E2E_TEST_USERNAME: ${{ secrets.E2E_TEST_USERNAME }}
# E2E_TEST_PASSWORD: ${{ secrets.E2E_TEST_PASSWORD }}
- name: Versionate
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
npm version ${{ github.event.inputs.version-increment }}
- name: Publish npm
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_PUBLISH }}
- name: Create PR
uses: peter-evans/[email protected]
with:
commit-message: Updated repository to ${{ steps.publish.outputs.version }}
title: Bump version to ${{ steps.publish.outputs.version }}
body: New release build
branch: release/${{ steps.publish.outputs.version }}
base: master