-
Notifications
You must be signed in to change notification settings - Fork 72
59 lines (50 loc) · 1.79 KB
/
publish-react.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
name: Create and publish React npm package
on:
workflow_dispatch:
inputs:
reactVersion:
required: true
type: choice
options:
- '17'
- '18'
description: The version of react you want to build
permissions:
contents: read
jobs:
publish_react:
runs-on: ubuntu-latest
if: github.repository == 'trimble-oss/modus-web-components'
defaults:
run:
working-directory: ./react-workspace/react-${{ github.event.inputs.reactVersion }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
# Setup Node, build, and publish to the npm, and GitHub registries
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Modus Web Components
run: npm ci
working-directory: ./stencil-workspace
- name: Build Modus Web Components
run: npm run build
working-directory: ./stencil-workspace
- name: Install React ${{ github.event.inputs.reactVersion }}
run: npm ci
- name: Build React ${{ github.event.inputs.reactVersion }}
run: npm run build
- name: Set npm Registry Auth Token
run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TRIMBLE_OSS_AUTOMATION_TOKEN }}
- name: Publish React npm Package Publicly
run: npm publish --access public
- name: Set GitHub Registry Auth Token
run: npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
- name: Publish React npm Package to GitHub Registry
run: npm publish --access public --ignore-scripts --@trimble-oss:registry='https://npm.pkg.github.com'