-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de2e4d6
Showing
16 changed files
with
2,199 additions
and
0 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,2 @@ | ||
[build] | ||
target = ["wasm32-wasi"] |
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,58 @@ | ||
name: build | ||
on: | ||
- push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
name: Build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: '1.76.0' | ||
target: wasm32-wasi | ||
- name: Install WasmEdge | ||
run: ./.github/workflows/install-wasmedge.sh | ||
- name: Install build dependencies | ||
run: ./build.sh dependencies | ||
- name: Build | ||
run: ./build.sh build | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts | ||
path: | | ||
dist/* | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
name: Release | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: dist | ||
merge-multiple: true | ||
- name: Install crane | ||
run: ./.github/workflows/install-crane.sh | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Release | ||
run: ./build.sh release | ||
- name: Release binary artifact | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
bodyFile: dist/release-notes.md | ||
artifacts: dist/*.tgz | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,22 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
# see https://github.com/google/go-containerregistry/releases | ||
version="${CRANE_VERSION:-0.19.0}" | ||
|
||
# bail when already installed. | ||
if [ -x "/usr/local/bin/crane" ]; then | ||
# e.g. 0.19.0 | ||
actual_version="$(/usr/local/bin/crane version)" | ||
if [ "$actual_version" == "$version" ]; then | ||
echo 'ANSIBLE CHANGED NO' | ||
exit 0 | ||
fi | ||
fi | ||
|
||
# download and install. | ||
url="https://github.com/google/go-containerregistry/releases/download/v$version/go-containerregistry_Linux_x86_64.tar.gz" | ||
t="$(mktemp -q -d --suffix=.crane)" | ||
wget -qO- "$url" | tar xzf - -C "$t" --strip-components=0 crane | ||
install -m 755 "$t/crane" /usr/local/bin/crane | ||
rm -rf "$t" |
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,22 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
# see https://github.com/WasmEdge/WasmEdge/releases | ||
WASMEDGE_VERSION="${WASMEDGE_VERSION:-0.13.5}" | ||
|
||
# bail when already installed. | ||
if [ -x /usr/local/bin/wasmedge ]; then | ||
# e.g. wasmedge version 0.13.5 | ||
actual_version="$(/usr/local/bin/wasmedge --version | perl -ne '/([^ ]+)$/ && print $1')" | ||
if [ "$actual_version" == "$WASMEDGE_VERSION" ]; then | ||
echo 'ANSIBLE CHANGED NO' | ||
exit 0 | ||
fi | ||
fi | ||
|
||
# download and install. | ||
wasmedge_url="https://github.com/WasmEdge/WasmEdge/releases/download/${WASMEDGE_VERSION}/WasmEdge-${WASMEDGE_VERSION}-ubuntu20.04_x86_64.tar.gz" | ||
rm -rf /opt/wasmedge | ||
install -d /opt/wasmedge | ||
wget -qO- "$wasmedge_url" | tar xzf - -C /opt/wasmedge --strip-components 1 | ||
ln -fs /opt/wasmedge/bin/wasmedge /usr/local/bin/ |
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,3 @@ | ||
target/ | ||
dist/ | ||
tmp/ |
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,7 @@ | ||
{ | ||
"cSpell.words": [ | ||
"askama", | ||
"wasi", | ||
"wasmedge" | ||
] | ||
} |
Oops, something went wrong.