Skip to content

Commit 5caa093

Browse files
committed
Merge branch 'main' of https://github.com/sr2echa/InterView
2 parents 10c9ab6 + 2bc655e commit 5caa093

File tree

2 files changed

+55
-49
lines changed

2 files changed

+55
-49
lines changed

.github/workflows/npm-publish.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish to both GitHub & npm
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
registry: [github, npm]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 18
25+
registry-url: ${{ matrix.registry == 'github' && 'https://npm.pkg.github.com' || 'https://registry.npmjs.org' }}
26+
scope: "@sr2echa"
27+
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v2
30+
with:
31+
version: latest
32+
33+
- name: Install deps
34+
run: |
35+
cd client
36+
pnpm install
37+
38+
- name: Adjust package name for npmjs (only)
39+
if: matrix.registry == 'npm'
40+
run: |
41+
cd client
42+
jq '.name = "interwu" | .publishConfig.registry = "https://registry.npmjs.org/"' package.json > tmp && mv tmp package.json
43+
44+
- name: Build and Test
45+
run: |
46+
cd client
47+
pnpm test --if-present
48+
npm pack
49+
50+
- name: Publish
51+
run: |
52+
cd client
53+
npm publish --access public
54+
env:
55+
NODE_AUTH_TOKEN: ${{ matrix.registry == 'github' && secrets.GH_NPM_TOKEN || secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)