-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (34 loc) · 1.07 KB
/
publish-release.yaml
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: 🚀 Publish Release
on:
push:
branches:
- 'main'
jobs:
publish:
permissions:
# Needed by googleapis/release-please-action@v4
contents: write
pull-requests: write
# Needed by `npm publish --provenance`
id-token: write
runs-on: ubuntu-latest
steps:
- name: 🍄 Bump package version, create GitHub release, and update changelog
uses: googleapis/release-please-action@v4
id: release
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created }}
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
- name: 🚀 Publish to npm
if: ${{ steps.release.outputs.release_created }}
run: |
npm install
npm run build --if-present
npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}