-
Notifications
You must be signed in to change notification settings - Fork 187
74 lines (62 loc) · 2.03 KB
/
npm-build.yml
File metadata and controls
74 lines (62 loc) · 2.03 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build Angular workspace
on:
push:
branches: [ v100 ]
pull_request:
branches: [ v100, v93 ]
jobs:
setup:
name: Setup
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Select Node version
id: node
shell: pwsh
run: |
# Determine branch (handles push vs PR)
$branch = "${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}"
# Select node version based on branch
switch ($branch) {
"v93" { $node = "20.x" }
"v100" { $node = "22.x" }
# Future changes:
# "v110" { $node = "24.x" }
default { $node = "22.x" }
}
# Output clear info for logs
Write-Host "🔹 Branch detected: $branch"
Write-Host "🔹 Node version selected: $node"
# Pass to subsequent steps
echo "version=$node" >> $env:GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: ${{ steps.node.outputs.version }}
- name: Install packages
working-directory: ./imxweb
run: |
npm install --skip-dialog
- name: Build All
working-directory: ./imxweb
run: npm run nx:build-all
timeout-minutes: 25
env:
NG_BUILD_PARALLEL: false
# - name: Test All
# working-directory: ./imxweb
# run: npm run nx:test-ci
# timeout-minutes: 40
# - name: Zip applications
# run: |
# apps=("qbm-app-landingpage" "qer-app-portal" "qer-app-pwdportal" "custom-app")
# for app in "${apps[@]}"; do
# if [ -d "./imxweb/dist/$app" ]; then
# ( cd "./imxweb/dist/$app" && zip -r "../Html_${app}.zip" . )
# fi
# done
# - name: Upload artifacts
# uses: actions/upload-artifact@v6
# with:
# name: imxweb-apps
# path: ./imxweb/dist/Html_*.zip