-
Notifications
You must be signed in to change notification settings - Fork 35
53 lines (51 loc) · 1.7 KB
/
Copy pathpublish.yml
File metadata and controls
53 lines (51 loc) · 1.7 KB
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
name: release-please
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
environment: release # Optional: for enhanced security
permissions:
contents: write
issues: write
pull-requests: write
steps:
# Generating a GitHub token, so that PRs and tags created by
# the release-please-action can trigger actions workflows.
- name: Generate GitHub token
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94
id: generate-token
with:
# GitHub App ID secret name
app-id: ${{ secrets.RELEASE_PLZ_APP_ID }}
# GitHub App private key secret name
private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38
id: release
with:
token: ${{ steps.generate-token.outputs.token }}
release-type: node
outputs:
release_created: ${{ steps.release.outputs.release_created }}
publish:
runs-on: ubuntu-latest
environment: release # Optional: for enhanced security
permissions:
contents: read
id-token: write
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
- name: Update npm
run: npm install -g npm@latest
- run: npm ci
- run: npm run build
- run: npm publish