From e111e430f8d883332a6b1c785007d4f6df44982b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 28 Jul 2022 10:42:46 +0200 Subject: [PATCH 1/8] Add cloudcompiler.yaml --- .github/workflows/cloudcompiler.yaml | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/cloudcompiler.yaml diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml new file mode 100644 index 00000000000..43e9011ac89 --- /dev/null +++ b/.github/workflows/cloudcompiler.yaml @@ -0,0 +1,52 @@ +name: Release cloudcompiler.wasm + +env: + RUST_BACKTRACE: 1 + +on: + pull_request: + branches: + - 'master' + workflow_dispatch: + +jobs: + setup: + name: Set up + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.59 + target: ${{ matrix.target }} + - name: Install wasm32-wasi target + shell: bash + run: | + rustup target add wasm32-wasi + - name: Build cloudcompiler.wasm + shell: bash + run: | + cargo build --release --target wasm32-wasi && + mkdir target/release/cloudcompiler && + cp target/release/wasmer.wasm target/release/cloudcompiler/cloudcompiler.wasm && + cat << EOF > target/release/cloudcompiler/wapm.toml + [package] + name = "${{ secrets.WAPM_DEV_USERNAME }}/cloudcompiler" + version = "$(git tag | tail -n1)" + description = "cloudcompiler.wasm" + license = "MIT" + repository = "https://github.com/wasmerio/wasmer" + + [[module]] + name = "cloudcompiler" + source = "cloudcompiler.wasm" + abi = "wasi" + + [module.interfaces] + wasi = "0.1.0-unstable" + + [[command]] + name = "cloudcompiler" + module = "cloudcompiler" + EOF \ No newline at end of file From 47d53db9ca0f54163c16ed942c72a2fa8468f453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 28 Jul 2022 11:28:57 +0200 Subject: [PATCH 2/8] Fix errors in cloudcompiler.yaml --- .github/workflows/cloudcompiler.yaml | 36 +++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml index 43e9011ac89..17c0f036a1e 100644 --- a/.github/workflows/cloudcompiler.yaml +++ b/.github/workflows/cloudcompiler.yaml @@ -15,6 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -24,16 +26,18 @@ jobs: shell: bash run: | rustup target add wasm32-wasi + - name: Setup Wasmer + uses: wasmerio/setup-wasmer@v1 - name: Build cloudcompiler.wasm shell: bash run: | - cargo build --release --target wasm32-wasi && - mkdir target/release/cloudcompiler && - cp target/release/wasmer.wasm target/release/cloudcompiler/cloudcompiler.wasm && - cat << EOF > target/release/cloudcompiler/wapm.toml + make build-wasmer-wasm && + mkdir target/wasm32-wasi/release/cloudcompiler + cp target/wasm32-wasi/release/wasmer-compiler.wasm target/wasm32-wasi/release/cloudcompiler/cloudcompiler.wasm && + cat << EOF > target/wasm32-wasi/release/cloudcompiler/wapm.toml [package] name = "${{ secrets.WAPM_DEV_USERNAME }}/cloudcompiler" - version = "$(git tag | tail -n1)" + version = "0.1.0" description = "cloudcompiler.wasm" license = "MIT" repository = "https://github.com/wasmerio/wasmer" @@ -49,4 +53,24 @@ jobs: [[command]] name = "cloudcompiler" module = "cloudcompiler" - EOF \ No newline at end of file + EOF + - name: Fix wapm.toml version + run: | + echo $(git tag | tail -n1) > ./version.txt + v=$(git describe --tags --abbrev=0) && \ + echo "version = ${v}" && + sed -i "s/version = \".*\"/${v}/g" target/wasm32-wasi/release/cloudcompiler/wapm.toml \ + - name: Build cloudcompiler.wasm + shell: bash + run: | + git tag && + cat target/wasm32-wasi/release/cloudcompiler/wapm.toml && + echo "ls" && + ls target/wasm32-wasi/release/cloudcompiler + - name: Publish to WAPM + uses: wasmerio/wapm-publish@v1 + with: + registry: https://registry.wapm.dev + directory: target/wasm32-wasi/release/cloudcompiler + username: ${{ secrets.WAPM_DEV_USERNAME }} + password: ${{ secrets.WAPM_DEV_PASSWORD }} \ No newline at end of file From c81d2cd128282278bd2f7698cb66360ae3518072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 29 Jul 2022 11:03:36 +0200 Subject: [PATCH 3/8] Fix error in cloudcompiler.yaml: fix sed command --- .github/workflows/cloudcompiler.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml index 17c0f036a1e..8b4b5ebd5ed 100644 --- a/.github/workflows/cloudcompiler.yaml +++ b/.github/workflows/cloudcompiler.yaml @@ -59,7 +59,7 @@ jobs: echo $(git tag | tail -n1) > ./version.txt v=$(git describe --tags --abbrev=0) && \ echo "version = ${v}" && - sed -i "s/version = \".*\"/${v}/g" target/wasm32-wasi/release/cloudcompiler/wapm.toml \ + sed -i "s/version = \".*\"/version = \"${v}\"/g" target/wasm32-wasi/release/cloudcompiler/wapm.toml \ - name: Build cloudcompiler.wasm shell: bash run: | From 353c1ee9a34d1461b0397dff74486f69e2334c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= <12084016+fschutt@users.noreply.github.com> Date: Tue, 2 Aug 2022 17:49:08 +0200 Subject: [PATCH 4/8] Only deploy cloudcompiler manually --- .github/workflows/cloudcompiler.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml index 8b4b5ebd5ed..5d3dd086a36 100644 --- a/.github/workflows/cloudcompiler.yaml +++ b/.github/workflows/cloudcompiler.yaml @@ -4,9 +4,6 @@ env: RUST_BACKTRACE: 1 on: - pull_request: - branches: - - 'master' workflow_dispatch: jobs: @@ -73,4 +70,4 @@ jobs: registry: https://registry.wapm.dev directory: target/wasm32-wasi/release/cloudcompiler username: ${{ secrets.WAPM_DEV_USERNAME }} - password: ${{ secrets.WAPM_DEV_PASSWORD }} \ No newline at end of file + password: ${{ secrets.WAPM_DEV_PASSWORD }} From 487101e972fe2b717130a8a881f6e4e639809f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= <12084016+fschutt@users.noreply.github.com> Date: Tue, 2 Aug 2022 17:55:32 +0200 Subject: [PATCH 5/8] Autopublish when creating the PR for a new release --- .github/workflows/cloudcompiler.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml index 5d3dd086a36..059b87c8215 100644 --- a/.github/workflows/cloudcompiler.yaml +++ b/.github/workflows/cloudcompiler.yaml @@ -4,6 +4,10 @@ env: RUST_BACKTRACE: 1 on: + push: + tags: + # trigger action on release branch + - '[0-9]+.[0-9]+.[0-9]+*' workflow_dispatch: jobs: From 36419ec7e48a9efecac336bd9cf4b120bc5e13f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 5 Aug 2022 12:45:42 +0200 Subject: [PATCH 6/8] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d57e4504490..e4437731723 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C ### Added ### Changed +- [#3048](https://github.com/wasmerio/wasmer/pull/3048) Automatically publish wasmer as "cloudcompiler" package to wapm.dev on every release - [#3075](https://github.com/wasmerio/wasmer/pull/3075) Remove __wbindgen_thread_id ### Fixed From 4710a2af2e5100dd46733e0799a8d3f0418ebeb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 5 Aug 2022 12:47:45 +0200 Subject: [PATCH 7/8] Add make build-wasmer-wasm to build.yml --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5cfe824d37..8c59eb3db38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -191,6 +191,11 @@ jobs: shell: bash run: | make build-wasmer + - name: Build Wasmer binary on Wasm32-WASI without LLVM + if: matrix.use_llvm != true + shell: bash + run: | + make build-wasmer-wasm - name: Build Wapm binary run: | make build-wapm From 298ba17c4b397bd562f5a41c10ef7a834e4cd0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 5 Aug 2022 13:02:26 +0200 Subject: [PATCH 8/8] Change test in build.yml to build_wasm flag --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c59eb3db38..7a839bb9566 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,7 @@ jobs: cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: true use_llvm: true + build_wasm: true - build: macos-x64 os: macos-11 llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz' @@ -55,12 +56,14 @@ jobs: cross_compilation_artifact_name: 'cross_compiled_from_mac' use_sccache: true use_llvm: true + build_wasm: false - build: macos-arm64 os: macos-11.0 target: aarch64-apple-darwin artifact_name: 'wasmer-darwin-arm64' use_sccache: true use_llvm: false + build_wasm: false - build: windows-x64 os: windows-2019 artifact_name: 'wasmer-windows-amd64' @@ -68,6 +71,7 @@ jobs: cross_compilation_artifact_name: 'cross_compiled_from_win' use_sccache: true use_llvm: true + build_wasm: false - build: linux-musl-x64 os: ubuntu-latest artifact_name: 'wasmer-linux-musl-amd64' @@ -75,6 +79,7 @@ jobs: container: alpine:latest use_sccache: false use_llvm: false + build_wasm: true container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -192,7 +197,7 @@ jobs: run: | make build-wasmer - name: Build Wasmer binary on Wasm32-WASI without LLVM - if: matrix.use_llvm != true + if: matrix.build_wasm shell: bash run: | make build-wasmer-wasm