Skip to content

Commit

Permalink
Merge pull request #3048 from wasmerio/cloudcompiler
Browse files Browse the repository at this point in the history
Add cloudcompiler.yaml
  • Loading branch information
syrusakbary authored Aug 5, 2022
2 parents 382459b + 298ba17 commit 663f922
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,38 @@ 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'
artifact_name: 'wasmer-darwin-amd64'
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'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz'
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'
#llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz'
container: alpine:latest
use_sccache: false
use_llvm: false
build_wasm: true
container: ${{ matrix.container }}
env:
SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob
Expand Down Expand Up @@ -191,6 +196,11 @@ jobs:
shell: bash
run: |
make build-wasmer
- name: Build Wasmer binary on Wasm32-WASI without LLVM
if: matrix.build_wasm
shell: bash
run: |
make build-wasmer-wasm
- name: Build Wapm binary
run: |
make build-wapm
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/cloudcompiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Release cloudcompiler.wasm

env:
RUST_BACKTRACE: 1

on:
push:
tags:
# trigger action on release branch
- '[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:

jobs:
setup:
name: Set up
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- 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: Setup Wasmer
uses: wasmerio/setup-wasmer@v1
- name: Build cloudcompiler.wasm
shell: bash
run: |
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 = "0.1.0"
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
- 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 = \".*\"/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 }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 663f922

Please sign in to comment.