-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
74 lines (66 loc) · 2.05 KB
/
Copy pathrelease-please.yml
File metadata and controls
74 lines (66 loc) · 2.05 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Release Please
on:
push:
branches:
- main
workflow_dispatch:
inputs:
target_branch:
description: "Branch to run Release Please against"
default: "main"
required: false
permissions:
contents: read
id-token: write
jobs:
release_please:
name: release-please
runs-on: ubuntu-latest
outputs:
releaseCreated: ${{ steps.release.outputs.release_created }}
version: ${{ steps.release.outputs.version }}
permissions:
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json
target-branch: ${{ inputs.target_branch || 'main' }}
npm_publish:
name: Publish to npm
runs-on: ubuntu-latest
environment: npm
needs: release_please
if: needs.release_please.outputs.releaseCreated
steps:
- uses: actions/checkout@v6
with:
show-progress: false
- uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
# If this step fails, it may be a transient issue, just run again
# https://github.com/mochajs/mocha/issues/5611
- name: Upgrade npm for OIDC support
run: npm install -g npm@latest
- name: Install dependencies
run: npm ci --ignore-scripts --force --no-fund --no-audit
- name: Determine npm dist-tag
id: dist_tag
env:
VERSION: ${{ needs.release_please.outputs.version }}
run: |
if [[ "$VERSION" == *-alpha* ]]; then
echo "tag=alpha" >> "$GITHUB_OUTPUT"
elif [[ "$VERSION" == *-* ]]; then
echo "tag=next" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- run: npm publish --provenance --access public --tag=${{ steps.dist_tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}