Skip to content

Commit ce27718

Browse files
authored
chore: pin node/npm version for build workflow (#1496)
Ok so during npm install symlinks were not being created where required. I believe this is some sort of regression with a new minor/patch version of node or npm. Using volta we already pin the node version locally, so it makes sense to do it in the workflow as well. Removed any explicit node versioning where it is unnecessary. Also combined all of the build into 1 command, because it shows the power of nx. Fixes #1479 🤞 *By submitting this pull request, I confirm that my contribution is made under the terms of the [Monada Contribution License](https://docs.winglang.io/terms-and-policies/contribution-license.html)*.
1 parent 7153c6f commit ce27718

File tree

5 files changed

+16
-29
lines changed

5 files changed

+16
-29
lines changed

.github/workflows/build.yml

+5-19
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
env:
18-
NODEJS_VERSION: "18.x"
1918
# Testing runs out of memory without this
2019
NODE_OPTIONS: "--max-old-space-size=4096"
2120
PROJEN_BUMP_VERSION: "0.0.0-dev.${{ github.run_id }}.${{ github.run_attempt }}"
@@ -100,10 +99,9 @@ jobs:
10099
- name: Checkout
101100
uses: actions/checkout@v3
102101

103-
- name: Setup Node
104-
uses: actions/setup-node@v3
105-
with:
106-
node-version: ${{ env.NODEJS_VERSION }}
102+
# Reads versions from root package.json "volta" section
103+
- name: Setup Node/NPM with pinned Volta version
104+
uses: volta-cli/[email protected]
107105

108106
- name: Install Rust
109107
uses: actions-rs/toolchain@v1
@@ -121,21 +119,14 @@ jobs:
121119
- name: Lint Nx
122120
run: npx nx workspace-lint
123121

124-
- name: Build and Unit Test
122+
- name: Build, Test, and Package
125123
uses: MansaGroup/nrwl-nx-action@v2
126124
with:
127-
targets: "build"
125+
targets: "build,test,package"
128126
all: true
129127
# Exclude E2E testing
130128
args: "--exclude=hangar --configuration=release --output-style=stream --verbose"
131129

132-
- name: Create NPM packages
133-
uses: MansaGroup/nrwl-nx-action@v2
134-
with:
135-
targets: "package"
136-
projects: "winglang,sdk"
137-
args: "--configuration=release --output-style=stream --verbose"
138-
139130
- name: Upload Wing CLI
140131
uses: actions/upload-artifact@v2
141132
with:
@@ -230,11 +221,6 @@ jobs:
230221
- name: Download Build Artifacts
231222
uses: actions/download-artifact@v2
232223

233-
- name: Setup Node
234-
uses: actions/setup-node@v3
235-
with:
236-
node-version: ${{ env.NODEJS_VERSION }}
237-
238224
- name: Tag commit
239225
uses: tvdias/[email protected]
240226
if: ${{ needs.prepare.outputs.last-version != needs.prepare.outputs.version }}

apps/jsii-docgen/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"executor": "nx:run-script",
77
"options": {
88
"cwd": "apps/jsii-docgen",
9-
"script": "build"
9+
"script": "compile"
1010
}
1111
}
1212
}

apps/wing-api-checker/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"executor": "nx:run-script",
77
"options": {
88
"cwd": "apps/wing-api-checker",
9-
"script": "build"
9+
"script": "compile"
1010
}
1111
}
1212
}

apps/wing-playground/package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
"contributors:check": "all-contributors check",
1717
"contributors:generate": "all-contributors generate",
1818
"docs": "./scripts/docsite.sh",
19-
"install:hangar": "npm --prefix tools/hangar install",
20-
"install:jsii-docgen": "npm --prefix apps/jsii-docgen install",
21-
"install:sdk": "npm --prefix libs/wingsdk install",
22-
"install:tree-sitter-wing": "npm --prefix libs/tree-sitter-wing install",
23-
"install:vscode-wing": "npm --prefix apps/vscode-wing install",
19+
"install:hangar": "npm --prefix tools/hangar --install-links=false install",
20+
"install:jsii-docgen": "npm --prefix apps/jsii-docgen --install-links=false install",
21+
"install:sdk": "npm --prefix libs/wingsdk --install-links=false install",
22+
"install:tree-sitter-wing": "npm --prefix libs/tree-sitter-wing --install-links=false install",
23+
"install:vscode-wing": "npm --prefix apps/vscode-wing --install-links=false install",
2424
"install:wasi": "bash scripts/setup_wasi.sh",
25-
"install:wing-api-checker": "npm --prefix apps/wing-api-checker install",
26-
"install:wing-playground": "npm --prefix apps/wing-playground install",
27-
"install:winglang": "npm --prefix apps/wing install",
25+
"install:wing-api-checker": "npm --prefix apps/wing-api-checker --install-links=false install",
26+
"install:wing-playground": "npm --prefix apps/wing-playground --install-links=false install",
27+
"install:winglang": "npm --prefix apps/wing --install-links=false install",
2828
"nx": "nx",
2929
"postinstall": "run-p -l --max-parallel 3 'install:*'",
3030
"test": "nx run-many --target=test --all=true"

0 commit comments

Comments
 (0)