-
-
Notifications
You must be signed in to change notification settings - Fork 36
56 lines (56 loc) · 1.68 KB
/
release-please.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
name: Release Please
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
publish-json-viewer:
name: 'Publish @textea/json-viewer'
needs: release-please
if: ${{ needs.release-please.outputs.releases_created }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-release-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-release-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-release
- name: Install Dependencies
run: yarn install
- name: Prepack
run: yarn run prepack
- name: Build
run: npm run build
- name: Delete Scripts
run: npm pkg delete scripts
- name: Delete Workspaces
run: npm pkg delete workspaces
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}