-
Notifications
You must be signed in to change notification settings - Fork 72
78 lines (65 loc) · 2.67 KB
/
publish-angular.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
67
68
69
70
71
72
73
74
75
76
77
78
name: Create and publish Angular npm package
on:
workflow_dispatch:
inputs:
angularVersion:
required: true
type: choice
options:
- '15'
- '16'
- '17'
- '18'
description: The version of Angular you want to build
permissions:
contents: read
jobs:
publish_angular:
runs-on: ubuntu-latest
if: github.repository == 'trimble-oss/modus-web-components'
defaults:
run:
working-directory: ./angular-workspace/ng${{ github.event.inputs.angularVersion }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
# Setup Node.js environment for Angular versions up to 16
- name: Setup Node.js environment (Angular <= 16)
if: ${{ github.event.inputs.angularVersion < 17 }}
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
# Setup Node.js environment specifically for Angular version 17 and above
- name: Setup Node.js environment (Angular >= 17)
if: ${{ github.event.inputs.angularVersion >= 17 }}
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: npm install
run: npm i
working-directory: ./angular-workspace/ng${{ github.event.inputs.angularVersion }}/projects/trimble-oss/modus-angular-components
- name: Install Angular ${{ github.event.inputs.angularVersion }}
run: npm ci
- name: Build Angular ${{ github.event.inputs.angularVersion }}
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 Angular npm Package Publicly
run: npm publish --access public
working-directory: ./angular-workspace/ng${{ github.event.inputs.angularVersion }}/dist/trimble-oss/modus-angular-components
- name: Set GitHub Registry Auth Token
run: npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
- name: Publish Angular npm Package to GitHub Registry
run: npm publish --access public --ignore-scripts --@trimble-oss:registry='https://npm.pkg.github.com'
working-directory: ./angular-workspace/ng${{ github.event.inputs.angularVersion }}/dist/trimble-oss/modus-angular-components