-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (44 loc) · 1.14 KB
/
create-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
name: Create release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.rp.outputs.release_created }}
tag_name: ${{ steps.rp.outputs.tag_name }}
upload_url: ${{ steps.rp.outputs.upload_url }}
steps:
- name: Release please
id: rp
uses: googleapis/release-please-action@v4
with:
release-type: node
build-publish:
name: Build and publish module
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.release_created }}
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Build assets
run: npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}