-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.46 KB
/
Copy pathpublish.yml
File metadata and controls
36 lines (34 loc) · 1.46 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
# GENERATED. Publishes @searchcode/cli when a version tag is pushed.
#
# A tag only reaches this repository from the private source repository, and it only pushes one
# after the live smoke test has passed against the production API. That smoke test is the gate
# that proves these clients match the API they describe; the tests below are the offline,
# structural half. See scripts/smoke-public-clients.mjs in the source repository.
name: publish
on:
push:
tags: ['v*']
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
# npm Trusted Publishing authenticates this workflow by its OIDC identity, so no token is
# needed. It cannot be used for a package's FIRST publish: a trusted publisher is configured
# on the package's settings page, which does not exist until the package has been published
# once. NPM_TOKEN covers that first release only; once trusted publishing is registered the
# secret is deleted and this falls back to OIDC automatically.
# Requires npm 11.5.1+, newer than the version bundled with the Node 22 runner.
- run: npm install -g npm@latest
- run: npm install
- run: npm test
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}