-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (47 loc) · 1.28 KB
/
publish.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Version and Publish APIs
on:
workflow_dispatch:
pull_request:
branches: [master]
push:
tags:
- "v**"
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
GITHUB_CR: ghcr.io
jobs:
publish:
name: Version and Publish APIs
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
# changelog generation requires full history
# to track each changelog file to its submission commit
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Lint code
run: pnpm lint
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
if: github.ref == 'refs/heads/master'
with:
version: pnpm ci:version
publish: pnpm ci:publish
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}