forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.16 KB
/
npm-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
name: npm Publish
on:
push:
branches:
- master
paths:
- '.github/workflows/npm-publish.yml'
- 'lib/**'
permissions:
contents: read
id-token: write
jobs:
build:
name: npm publish
if: github.repository == 'DIYgod/RSSHub'
runs-on: ubuntu-latest
timeout-minutes: 5
env:
HUSKY: 0
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
# pinned to 18 until https://github.com/compulim/version-from-git/issues/16 is fixed
node-version: 18
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies (pnpm)
run: pnpm i
- name: Run postinstall script for dependencies
run: pnpm rb
- name: Release
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
npx version-from-git --allow-same-version --template 'master.short'
- name: Publish to npmjs
run: pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}