Skip to content

Commit

Permalink
Merge pull request #323 from permaweb/peterfarber/wasm-workflows
Browse files Browse the repository at this point in the history
ci: implement release of aos modules
  • Loading branch information
TillaTheHun0 authored Aug 13, 2024
2 parents d67ae13 + 786e0f8 commit fb35266
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 7 deletions.
78 changes: 71 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ jobs:
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
# TODO: will need when we add automatically bumping based on semver, later
# with:
# fetch-depth: 0
# ref: main

- name: ⎔ Setup node
uses: actions/setup-node@v4
Expand All @@ -103,8 +104,6 @@ jobs:
- name: 🤖 Setup ao dev-cli
run: |
curl -fsSL https://install_ao.g8way.io | bash
export PATH="${AO_INSTALL:-$HOME/.ao}/bin:$PATH"
which ao
- name: 👀 Env
run: |
Expand All @@ -124,9 +123,74 @@ jobs:
run: |
yarn
- name: Placeholder
# Build aos
- name: Build aos Module
id: aos_module
run: |
if [ -d "process/libs" ]; then rm -rf process/libs; fi
if [ -e "process/process.wasm" ]; then rm -f process/process.wasm; fi
if [ -e "process/config.yml" ]; then rm -f process/config.yml; fi
(cd process && /home/runner/.ao/bin/ao build)
AOS_MODULE_PATH="$PWD/process/process.wasm"
echo "aos_module_path=${AOS_MODULE_PATH}" >> $GITHUB_OUTPUT
# TODO: instead upload to Arweave as ao Module DataItem
- name: 🗃 Upload aos Module
uses: actions/upload-artifact@v4
with:
name: aos.wasm
path: ${{ steps.aos_module.outputs.aos_module_path }}
retention-days: 10

# Build aos-sqlite
- name: 🗄️ Build aos SQLite Module
id: aos_sqlite_module
if: inputs.sqlite
run: |
echo "::warning::TODO: Implement Release"
if [ -d "process/libs" ]; then rm -rf process/libs; fi
if [ -e "process/process.wasm" ]; then rm -f process/process.wasm; fi
if [ -e "process/config.yml" ]; then rm -f process/config.yml; fi
cp -r modules/sqlite3/. process/
(cd process && /home/runner/.ao/bin/ao build)
AOS_MODULE_PATH="$PWD/process/process.wasm"
echo "aos_module_path=${AOS_MODULE_PATH}" >> $GITHUB_OUTPUT
# TODO: instead upload to Arweave as ao Module DataItem
- name: 🗃 Upload aos SQLite Module
if: inputs.sqlite
uses: actions/upload-artifact@v4
with:
name: aos-sqlite.wasm
path: ${{ steps.aos_sqlite_module.outputs.aos_module_path }}
retention-days: 10

# Build aos-llama
- name: 🦙 Build aos Llama Module
id: aos_llama_module
if: inputs.llama
run: |
if [ -d "process/libs" ]; then rm -rf process/libs; fi
if [ -e "process/process.wasm" ]; then rm -f process/process.wasm; fi
if [ -e "process/config.yml" ]; then rm -f process/config.yml; fi
cp -r modules/llama/. ./process/
(cd process && /home/runner/.ao/bin/ao build)
AOS_MODULE_PATH="$PWD/process/process.wasm"
echo "aos_module_path=${AOS_MODULE_PATH}" >> $GITHUB_OUTPUT
# TODO: instead upload to Arweave as ao Module DataItem
- name: 🗃 Upload aos Llama Module
if: inputs.llama
uses: actions/upload-artifact@v4
with:
name: aos-llama.wasm
path: ${{ steps.aos_llama_module.outputs.aos_module_path }}
retention-days: 10

# TODO: update manifests with new version and txids

Expand Down
2 changes: 2 additions & 0 deletions modules/llama/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
preset: 'xxl'
keep_js: true
Binary file added modules/llama/libs/common/libcommon.a
Binary file not shown.
Binary file added modules/llama/libs/libaollama.so
Binary file not shown.
Binary file added modules/llama/libs/libaostream.so
Binary file not shown.
Binary file added modules/llama/libs/libllama.a
Binary file not shown.
6 changes: 6 additions & 0 deletions modules/sqlite3/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extra_compile_args: [
'-DSQLITE_ENABLE_MATH_FUNCTIONS',
'-DSQLITE_ENABLE_GEOPOLY',
'-DSQLITE_ENABLE_FTS5',
'-DSQLITE_ENABLE_API_ARMOR'
]
Binary file added modules/sqlite3/libs/lsqlite3.a
Binary file not shown.
Binary file added modules/sqlite3/libs/sqlite3.a
Binary file not shown.

0 comments on commit fb35266

Please sign in to comment.