-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.3 KB
/
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
name: Publish Package to npmjs
on:
pull_request:
types: [closed]
permissions:
contents: write # Clone repo and release
id-token: write # Upload to pages
concurrency:
group: "release"
cancel-in-progress: false
jobs:
if-merged:
name: Check if PR merged to mai nevent
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- run: echo "PR merged"
build:
needs: [if-merged]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
- name: Create Release
uses: actions/create-release@v1
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{github.ref_name }}
tag_name: ${{ steps.package-version.outputs.current-version}}
release_name: Release ${{ steps.package-version.outputs.current-version}}
draft: false
prerelease: false
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}