-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 1.74 KB
/
publish.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Publish to NPM
on:
push:
branches:
- main
tags-ignore:
- v*
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
- run: yarn install --frozen-lockfile
- name: Lint
run: yarn run lint
- name: Test
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: yarn run test
# - name: Publish
# run: |
# git config --global user.email "actions@github.com"
# git config --global user.name "interbot"
# npm set //registry.npmjs.org/:_authToken=${{secrets.NPM_AUTH_TOKEN}}
# npm whoami
release:
name: Release
needs: test
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: npx semantic-release