summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorAnuraag Agrawal <anuraaga@gmail.com>2023-06-12 14:15:54 +0900
committerGitHub <noreply@github.com>2023-06-12 05:15:54 +0000
commite425ccb3095ef3a845b3248b44de1f6b427ddcad (patch)
treef24df4164b482858e44260b05fb00be4e1aa9fd8 /.github
parentbd6ad17fb534c092f896cb01eaf2c43b78fff589 (diff)
downloadwabt-e425ccb3095ef3a845b3248b44de1f6b427ddcad.tar.gz
wabt-e425ccb3095ef3a845b3248b44de1f6b427ddcad.tar.bz2
wabt-e425ccb3095ef3a845b3248b44de1f6b427ddcad.zip
Add build and publishing of wabt tools with wasi (#2254)
Diffstat (limited to '.github')
-rw-r--r--.github/actions/release-archive/action.yml47
-rw-r--r--.github/workflows/build.yml15
-rw-r--r--.github/workflows/build_release.yml43
3 files changed, 80 insertions, 25 deletions
diff --git a/.github/actions/release-archive/action.yml b/.github/actions/release-archive/action.yml
new file mode 100644
index 00000000..a81cf918
--- /dev/null
+++ b/.github/actions/release-archive/action.yml
@@ -0,0 +1,47 @@
+name: Upload release archive
+description: Bundles an archive of artifacts and uploads to a GitHub release. The artifacts must already have been built into the folder "install".
+inputs:
+ os:
+ description: The OS runner name being built, used in the archive name
+ required: true
+ upload_to_release:
+ description: Whether to upload the archives to the release
+runs:
+ using: composite
+ steps:
+ - name: archive
+ id: archive
+ shell: bash
+ run: |
+ OSNAME=$(echo ${{ inputs.os }} | sed 's/-latest//')
+ VERSION=${{ github.ref_name }}
+ PKGNAME="wabt-$VERSION-$OSNAME"
+ TARBALL=$PKGNAME.tar.gz
+ SHASUM=$PKGNAME.tar.gz.sha256
+ mv install wabt-$VERSION
+ tar -czf $TARBALL wabt-$VERSION
+ scripts/sha256sum.py $TARBALL > $SHASUM
+ echo "::set-output name=tarball::$TARBALL"
+ echo "::set-output name=shasum::$SHASUM"
+
+ - name: upload tarball to CI
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ steps.archive.outputs.tarball }}
+ path: ./${{ steps.archive.outputs.tarball }}
+
+ - name: upload tarball to release
+ uses: svenstaro/upload-release-action@v2
+ if: ${{ inputs.upload_to_release }}
+ with:
+ file: ./${{ steps.archive.outputs.tarball }}
+ asset_name: ${{ steps.archive.outputs.tarball }}
+ tag: ${{ github.ref }}
+
+ - name: upload shasum
+ uses: svenstaro/upload-release-action@v2
+ if: ${{ inputs.upload_to_release }}
+ with:
+ file: ./${{ steps.archive.outputs.shasum }}
+ asset_name: ${{ steps.archive.outputs.shasum }}
+ tag: ${{ github.ref }}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e8092c98..937f6d24 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -80,6 +80,21 @@ jobs:
docker exec emscripten emcc -v
docker exec emscripten emcmake cmake .
docker exec emscripten make -j 2 VERBOSE=1
+ wasi:
+ name: wasi
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: build-tools
+ run: |
+ docker run -di --name wasi-sdk -v $(pwd):/src --workdir /src ghcr.io/webassembly/wasi-sdk:wasi-sdk-20 bash
+ docker exec wasi-sdk cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DBUILD_TESTS=0 -DBUILD_LIBWASM=0
+ docker exec wasi-sdk cmake --build out --config Release --target install
+ - uses: ./.github/actions/release-archive
+ with:
+ os: wasi
sanitize:
name: sanitize
diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml
index 285423fb..95be7a75 100644
--- a/.github/workflows/build_release.yml
+++ b/.github/workflows/build_release.yml
@@ -58,32 +58,25 @@ jobs:
run: find bin/ -type f -perm -u=x -exec strip {} +
if: matrix.os != 'windows-latest'
- - name: archive
- id: archive
- run: |
- OSNAME=$(echo ${{ matrix.os }} | sed 's/-latest//')
- VERSION=${{ github.event.release.tag_name }}
- PKGNAME="wabt-$VERSION-$OSNAME"
- TARBALL=$PKGNAME.tar.gz
- SHASUM=$PKGNAME.tar.gz.sha256
- mv install wabt-$VERSION
- tar -czf $TARBALL wabt-$VERSION
- scripts/sha256sum.py $TARBALL > $SHASUM
- echo "::set-output name=tarball::$TARBALL"
- echo "::set-output name=shasum::$SHASUM"
+ - uses: ./.github/actions/release-archive
+ with:
+ os: ${{ matrix.os }}
+ upload_to_release: true
- - name: upload tarball
- uses: svenstaro/upload-release-action@v2
+ build-wasi:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
with:
- repo_token: ${{ secrets.GITHUB_TOKEN }}
- file: ./${{ steps.archive.outputs.tarball }}
- asset_name: ${{ steps.archive.outputs.tarball }}
- tag: ${{ github.ref }}
+ submodules: true
+
+ - name: built-tools
+ run: |
+ docker run -di --name wasi-sdk -v $(pwd):/src --workdir /src ghcr.io/webassembly/wasi-sdk:wasi-sdk-20 bash
+ docker exec wasi-sdk cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DBUILD_TESTS=0 -DBUILD_LIBWASM=0
+ docker exec wasi-sdk cmake --build out --config Release --target install
- - name: upload shasum
- uses: svenstaro/upload-release-action@v2
+ - uses: ./.github/actions/release-archive
with:
- repo_token: ${{ secrets.GITHUB_TOKEN }}
- file: ./${{ steps.archive.outputs.shasum }}
- asset_name: ${{ steps.archive.outputs.shasum }}
- tag: ${{ github.ref }}
+ os: wasi
+ upload_to_release: true