-
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.57 KB
/
release.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: Release
on:
push:
tags:
- 'v*'
permissions:
id-token: write
contents: write
pull-requests: write
env:
HUSKY: 0
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
skip: false
jobs:
release:
if: github.repository == 'yxw007/translate'
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
ref: master
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 8
run_install: false
- name: Install Node.js
uses: actions/setup-node@v3
with:
cache: pnpm
registry-url: https://registry.npmjs.org
- name: Install modules
run: pnpm install --no-frozen-lockfile
- name: Install tsx
run: pnpm install -g tsx
- name: Build
run: pnpm build
- name: Set npmrc
if: env.skip == 'false'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
echo "registry=https://registry.npmjs.org" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
- uses: actions/setup-node@v4
if: env.skip == 'false'
with:
node-version: '20.x'
# Note: Registration-url must be set here, otherwise the permissions will be wrong
registry-url: 'https://registry.npmjs.org'
- name: Publish package
if: env.skip == 'false'
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}