-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: release workflow for comlink packages
* separate map_std, nodejs_comlink and comlink_language_server into a separate workflow * abstract core_build action, which takes care of building any core component (core.wasm, test-core.wasm, comlink.wasm) * remove option to build all hosts at once, it doesn't properly work anyway * add changelogs, version files, gitignore
- Loading branch information
1 parent
9d0396d
commit 227dd33
Showing
11 changed files
with
461 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: "Prepare core" | ||
description: "Build core components" | ||
|
||
inputs: | ||
CARGO_PROFILE: | ||
description: "Cargo profile name to use for cargo cache key" | ||
required: false | ||
default: 'release' | ||
CORE_WASM: | ||
description: "Whether to build core.wasm and core-async.wasm, oneOf `none, build, upload`" | ||
required: false | ||
default: 'none' | ||
TEST_CORE_WASM: | ||
description: "Whether to build test-core.wasm and test-core-async.wasm, oneOf `none, build, upload`" | ||
required: false | ||
default: 'none' | ||
COMLINK_WASM: | ||
description: "Whether to build comlink.wasm, oneOf `none, build, upload`" | ||
required: false | ||
default: 'none' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-node@v3 | ||
with: | ||
registry-url: https://registry.npmjs.org/ | ||
node-version: "18" | ||
cache: yarn | ||
cache-dependency-path: core_js/yarn.lock | ||
- name: Cache cargo registry and build directory | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/git | ||
~/.cargo/registry/cache | ||
~/.cargo/registry/index | ||
core/target | ||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-${{ inputs.CARGO_PROFILE }} | ||
restore-keys: | | ||
cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}- | ||
cargo-${{ runner.os }}- | ||
- name: Cache WASI SDK | ||
uses: actions/cache@v3 | ||
with: | ||
path: core/wasi-sdk-* | ||
key: wasisdk-${{ runner.os }}-${{ runner.arch }} | ||
- name: Install wasm-opt | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install binaryen | ||
- name: Install rust target | ||
shell: bash | ||
run: rustup target add wasm32-wasi | ||
# build and store core.wasm, core-async.wasm | ||
- name: Run make to build core.wasm | ||
if: ${{ inputs.CORE_WASM != 'none' }} | ||
env: | ||
CARGO_INCREMENTAL: "0" # disable incremental to reduce load on the cache | ||
shell: bash | ||
run: make core/dist/core.wasm core/dist/core-async.wasm OS=${{ runner.os }} CARGO_PROFILE=${{ inputs.CARGO_PROFILE }} | ||
- name: Upload artifact core-async.wasm | ||
if: ${{ inputs.CORE_WASM == 'upload' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: core-async-wasm | ||
path: core/dist/core-async.wasm | ||
- name: Upload artifact core.wasm | ||
if: ${{ inputs.CORE_WASM == 'upload' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: core-wasm | ||
path: core/dist/core.wasm | ||
# build and store test-core.wasm and test-core-async.wasm | ||
- name: Run make to build core.wasm | ||
if: ${{ inputs.TEST_CORE_WASM == 'build' }} | ||
env: | ||
CARGO_INCREMENTAL: "0" # disable incremental to reduce load on the cache | ||
shell: bash | ||
run: make core/dist/test-core.wasm core/dist/test-core-async.wasm OS=${{ runner.os }} CARGO_PROFILE=${{ inputs.CARGO_PROFILE }} | ||
- name: Upload artifact test-core-async.wasm | ||
if: ${{ inputs.TEST_CORE_WASM == 'upload' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-core-async-wasm | ||
path: core/dist/test-core-async.wasm | ||
- name: Upload artifact core.wasm | ||
if: ${{ inputs.TEST_CORE_WASM == 'upload' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-core-wasm | ||
path: core/dist/test-core.wasm | ||
# build and store comlink.wasm | ||
- name: Run make to build comlink.wasm | ||
if: ${{ inputs.COMLINK_WASM == 'build' }} | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
shell: bash | ||
run: make core/dist/comlink.wasm OS=${{ runner.os }} CARGO_PROFILE=${{ inputs.CARGO_PROFILE }} | ||
- name: Upload artifact comlink.wasm | ||
if: ${{ inputs.TEST_CORE_WASM == 'upload' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: comlink-wasm | ||
path: core/dist/comlink.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.