-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (48 loc) · 1.48 KB
/
publish.yml
File metadata and controls
50 lines (48 loc) · 1.48 KB
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
name: Publish
on:
push:
branches:
- master
jobs:
publish:
concurrency:
group: publish
cancel-in-progress: false
runs-on: ubuntu-latest
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
scope: '@foo-software'
registry-url: 'https://registry.npmjs.org'
always-auth: true
- name: Full Clean (no npm cache)
run: |
rm -rf node_modules
rm -rf packages/*/node_modules
- name: Use stable npm version
run: npm install -g npm@9.9.0
- name: Install
run: |
npm ci
npm run lerna -- bootstrap --hoist
- name: Show installed type versions
run: |
npm ls @types/node || true
npm ls @jest/types || true
- name: Publish Packages
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# Force npm to use an explicit userconfig (matches the local workaround that actually publishes)
printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" > "${GITHUB_WORKSPACE}/.npmrc"
export NPM_CONFIG_USERCONFIG="${GITHUB_WORKSPACE}/.npmrc"
npm whoami
node packages/foo-api-ci-tools/dist/bin/config-git.js
node packages/foo-api-ci-tools/dist/bin/publish-packages.js