Skip to content

Commit 5b12656

Browse files
committed
Fix errors in cloudcompiler.yaml
1 parent 36a7fee commit 5b12656

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/cloudcompiler.yaml

+30-6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
1820
- name: Install Rust
1921
uses: dtolnay/rust-toolchain@stable
2022
with:
@@ -24,16 +26,18 @@ jobs:
2426
shell: bash
2527
run: |
2628
rustup target add wasm32-wasi
29+
- name: Setup Wasmer
30+
uses: wasmerio/setup-wasmer@v1
2731
- name: Build cloudcompiler.wasm
2832
shell: bash
2933
run: |
30-
cargo build --release --target wasm32-wasi &&
31-
mkdir target/release/cloudcompiler &&
32-
cp target/release/wasmer.wasm target/release/cloudcompiler/cloudcompiler.wasm &&
33-
cat << EOF > target/release/cloudcompiler/wapm.toml
34+
make build-wasmer-wasm &&
35+
mkdir target/wasm32-wasi/release/cloudcompiler
36+
cp target/wasm32-wasi/release/wasmer-compiler.wasm target/wasm32-wasi/release/cloudcompiler/cloudcompiler.wasm &&
37+
cat << EOF > target/wasm32-wasi/release/cloudcompiler/wapm.toml
3438
[package]
3539
name = "${{ secrets.WAPM_DEV_USERNAME }}/cloudcompiler"
36-
version = "$(git tag | tail -n1)"
40+
version = "0.1.0"
3741
description = "cloudcompiler.wasm"
3842
license = "MIT"
3943
repository = "https://github.com/wasmerio/wasmer"
@@ -49,4 +53,24 @@ jobs:
4953
[[command]]
5054
name = "cloudcompiler"
5155
module = "cloudcompiler"
52-
EOF
56+
EOF
57+
- name: Fix wapm.toml version
58+
run: |
59+
echo $(git tag | tail -n1) > ./version.txt
60+
v=$(git describe --tags --abbrev=0) && \
61+
echo "version = ${v}" &&
62+
sed -i "s/version = \".*\"/${v}/g" target/wasm32-wasi/release/cloudcompiler/wapm.toml \
63+
- name: Build cloudcompiler.wasm
64+
shell: bash
65+
run: |
66+
git tag &&
67+
cat target/wasm32-wasi/release/cloudcompiler/wapm.toml &&
68+
echo "ls" &&
69+
ls target/wasm32-wasi/release/cloudcompiler
70+
- name: Publish to WAPM
71+
uses: wasmerio/wapm-publish@v1
72+
with:
73+
registry: https://registry.wapm.dev
74+
directory: target/wasm32-wasi/release/cloudcompiler
75+
username: ${{ secrets.WAPM_DEV_USERNAME }}
76+
password: ${{ secrets.WAPM_DEV_PASSWORD }}

0 commit comments

Comments
 (0)