-
-
Notifications
You must be signed in to change notification settings - Fork 102
50 lines (45 loc) · 1.3 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
name: release
on:
push:
branches:
- main
tags:
- '*.*.*'
pull_request:
types:
- labeled
jobs:
release:
if: github.event.action != 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1
# Get tag name.
- id: tag
uses: haya14busa/action-cond@v1
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
if_false: ${{ steps.bumpr.outputs.next_version }}
- name: Release
uses: justincy/github-action-npm-release@2.0.2
id: release
- uses: actions/setup-node@v3
if: steps.release.outputs.released == 'true'
with:
registry-url: 'https://registry.npmjs.org'
node-version: 16
- name: Publish
if: steps.release.outputs.released == 'true'
run: echo "//registry.npmjs.org/:_authToken=${{secrets.npm_token}}" > .npmrc && npm ci && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
release-check:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1