Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
waozixyz committed Jan 22, 2025
1 parent a450fa1 commit ec89a89
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,50 @@ on:
pull_request:
branches: [ axis ]

env:
EM_VERSION: '3.1.74' # Specify the Emscripten version
EM_CACHE_FOLDER: 'emsdk-cache' # Folder to cache Emscripten SDK and system libraries

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential clang lld cmake ninja-build pkg-config
- name: Install xmake
run: |
wget https://xmake.io/shget.text -O - | bash
source ~/.xmake/profile

# Step 2: Set up Emscripten with caching
- name: Cache Emscripten SDK and system libraries
id: cache-emsdk
uses: actions/cache@v3
with:
path: ${{ env.EM_CACHE_FOLDER }}
key: emsdk-${{ env.EM_VERSION }}-${{ runner.os }}-${{ hashFiles('**/xmake.lua') }}
restore-keys: |
emsdk-${{ env.EM_VERSION }}-${{ runner.os }}-
emsdk-${{ env.EM_VERSION }}-
- name: Set up Emscripten
uses: mymindstorm/setup-emsdk@v12
uses: mymindstorm/setup-emsdk@v14
with:
version: '3.1.45'
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}

# Step 3: Install xmake
- name: Install xmake
run: |
wget https://xmake.io/shget.text -O - | bash
source ~/.xmake/profile
# Step 4: Build for Web (WASM)
- name: Build for Web (WASM)
run: |
xmake f -p wasm -y
xmake -y
# Step 5: Prepare artifacts
- name: Prepare artifacts
run: |
mkdir -p netlify-build
Expand All @@ -45,6 +59,7 @@ jobs:
cp -r fonts netlify-build/
cp -r images netlify-build/
# Step 6: Deploy to Netlify
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2
with:
Expand Down

0 comments on commit ec89a89

Please sign in to comment.