Skip to content

Commit

Permalink
Add/wasm build (#31470)
Browse files Browse the repository at this point in the history
  • Loading branch information
padmaia authored Nov 17, 2021
1 parent af6e9e2 commit b80c378
Show file tree
Hide file tree
Showing 248 changed files with 568 additions and 388 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ packages/create-next-app/templates/**
test/integration/eslint/**
test/development/basic/legacy-decorators/**/*
test-timings.json
packages/next/build/swc/tests/**
packages/next/build/swc/crates/**
bench/nested-deps/pages/**
bench/nested-deps/components/**
70 changes: 70 additions & 0 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1129,3 +1129,73 @@ jobs:
with:
name: next-swc-binaries
path: packages/next/native/next-swc.android-arm64.node

build-wasm:
needs: build
strategy:
matrix:
target: [web, nodejs]
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-08-12
override: true
target: wasm32-unknown-unknown

- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/
**/target/
key: ${{ runner.os }}-publish-integration

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build
run: (wasm-pack build packages/next/build/swc/crates/wasm --release --scope=next --target ${{ matrix.target }})

- name: Add target to folder name
run: mv packages/next/build/swc/crates/wasm/pkg packages/next/build/swc/crates/wasm/pkg-${{ matrix.target }}

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: wasm-binaries
path: packages/next/build/swc/crates/wasm/pkg-*

- run: ls packages/next/build/swc/crates/wasm

# - name: Publish
# run: |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
# (cd crates/wasm/pkg && npm publish --access public)
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

practice:
needs: build-wasm
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: wasm-binaries
path: packages/next/build/swc/crates/wasm

- run: ls packages/next/build/swc/crates/wasm
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages/react-dev-overlay/lib/**
**/__tmp__/**
lerna.json
.github/actions/next-stats-action/.work
packages/next/build/swc/tests/**/*
packages/next/build/swc/crates/**/*
packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore_staged
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**/.next/**
**/_next/**
**/dist/**
packages/next/build/swc/tests/**
packages/next/build/swc/crates/**
packages/next/compiled/**/*
packages/next/bundles/webpack/packages/*.runtime.js
lerna.json
Expand Down
Loading

0 comments on commit b80c378

Please sign in to comment.