Skip to content

Commit

Permalink
chore(repo): turbo caching improvements and minor packaging simplific…
Browse files Browse the repository at this point in the history
…ation (#3913)

Subset of changes from #3791, avoiding the titular "skip hangar" part.

Primary Goal: Tweak turbo configuration to both more granular and more accurate in general

Changes:
- (turbo) Tests do not effect compile/package output
- (turbo) Stop using `src/**` when possible, using more specific file extensions
- Make wingc.wasm and docs.tgz part of npm scripts and put the result alongside the other distributables
  - the github workflow was simplified to be able to just upload/download all these dists
- (workflow) Made sure rust only caches in the test workflow, otherwise the build and test workflows fight over the cache
- Fixed #3842 by explicitly publishing packages in order. Might do something more robust later, but this at least avoids the out-of-order issue
- Deleted several extra license files (projen generated a `LICENSE`, while we had `LICENSE.md` as well)

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
  • Loading branch information
MarkMcCulloh authored Aug 23, 2023
1 parent 6a0ebfb commit b547c18
Show file tree
Hide file tree
Showing 23 changed files with 73 additions and 349 deletions.
76 changes: 24 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ env:
RUST_VERSION: "1.67.1"
NODE_VERSION: "18.16.0"
PNPM_VERSION: "8.6.3"
CARGO_TERM_COLOR: always
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

jobs:
build:
name: "Build"
timeout-minutes: 30
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
outputs:
version: ${{ fromJson(steps.changelog.outputs.data).newVersion }}
last-version: ${{ fromJson(steps.changelog.outputs.data).lastVersion }}
Expand Down Expand Up @@ -66,6 +65,9 @@ jobs:

- name: Setup Cargo Cache
uses: Swatinem/rust-cache@v2
with:
# Don't save cache here, to avoid thrashing with test job
save-if: false

- name: Install Dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -81,18 +83,6 @@ jobs:
env:
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tgz

- name: Upload WingC WASM
uses: actions/upload-artifact@v3
with:
name: wingc
path: libs/wingcompiler/wingc.wasm

- name: Derive appropriate SHAs for base and head
id: setSHAs
uses: nrwl/nx-set-shas@v3
Expand All @@ -106,35 +96,19 @@ jobs:
echo "diff=true" >> "$GITHUB_OUTPUT"
fi
- name: Upload Extension
uses: actions/upload-artifact@v3
with:
name: vscode-wing
path: apps/vscode-wing/vscode-wing.vsix

- name: Compress Docs
run: tar -czvf docs.tgz docs/*

- name: Upload Docs
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: docs.tgz
name: dist
path: dist/*

test:
name: Test
timeout-minutes: 30
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup pnpm
uses: pnpm/[email protected]
Expand Down Expand Up @@ -227,7 +201,7 @@ jobs:
path: tools/hangar/results/report.json

- name: Create Markdown report
run: node scripts/benchmark_json_to_table.mjs
run: scripts/benchmark_json_to_table.mjs

e2e-test:
name: "E2E / ${{ matrix.runner }} + Node${{ matrix.node }} [${{ matrix.shard }}]"
Expand All @@ -254,8 +228,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup pnpm
uses: pnpm/[email protected]
Expand Down Expand Up @@ -349,25 +321,28 @@ jobs:
repo-token: "${{ secrets.PROJEN_GITHUB_TOKEN }}"
tag: "v${{ needs.build.outputs.version }}"

- name: Login to NPM registry
run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Publish npm packages
working-directory: dist
env:
PACKAGE_VERSION: ${{ needs.build.outputs.version }}
run: |
PACKAGES=("winglang-sdk" "winglang-compiler" "wingconsole-design-system" "wingconsole-ui" "wingconsole-server" "wingconsole-app")
for PACKAGE in $PACKAGES; do
npm publish "$PACKAGE-$PACKAGE_VERSION.tgz" --access public
done
- name: Publish Extension to Visual Studio Marketplace
if: needs.build.outputs.vscode-wing-changed == 'true'
uses: "HaaLeo/publish-vscode-extension@v1"
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: "https://marketplace.visualstudio.com"
extensionFile: "vscode-wing/vscode-wing.vsix"
extensionFile: "dist/vscode-wing.vsix"
dependencies: false

- name: Login to NPM registry
run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Publish npm packages
run: |
for file in *.tgz; do
npm publish "$file" --access public
done
working-directory: dist

- name: Write Changelog
uses: DamianReeves/[email protected]
with:
Expand All @@ -377,9 +352,6 @@ jobs:

- name: Compute Checksums
run: |
mv ./docs/*.tgz ./dist
mv ./*/*.vsix ./dist
mv ./*/*.wasm ./dist
mv ./benchmarks/* ./dist
cd dist
Expand Down
202 changes: 0 additions & 202 deletions apps/jsii-docgen/LICENSE.md

This file was deleted.

2 changes: 1 addition & 1 deletion apps/vscode-wing/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion apps/vscode-wing/.projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ project.watchTask.reset("tsup --watch");
project.packageTask.reset(
"pnpm version ${PROJEN_BUMP_VERSION:-0.0.0} --allow-same-version"
);
project.packageTask.exec("vsce package --no-dependencies -o vscode-wing.vsix");
project.packageTask.exec(
"vsce package --no-dependencies -o ../../dist/vscode-wing.vsix"
);

project.addFields({
volta: {
Expand Down
19 changes: 0 additions & 19 deletions apps/vscode-wing/LICENSE.md

This file was deleted.

Loading

0 comments on commit b547c18

Please sign in to comment.