Skip to content

Fix c warnings - debug mode #528

Fix c warnings - debug mode

Fix c warnings - debug mode #528

Workflow file for this run

name: Build and Deploy WebAssembly
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update OS
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
- name: Install Emscripten
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install emscripten
- name: Install Node.js and npx
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs npm
npx --version
- name: Run WebAssembly build script
run: |
chmod +x build-webassembly.sh
bash build-webassembly.sh
- name: Clone Salam-Editor repository
run: |
FIRST_NAME="Max"
DOMAIN="gmail.com"
EMAIL="${FIRST_NAME}BaseCode@${DOMAIN}"
git clone https://github.com/SalamLang/Salam-Editor.git
git config --global user.name "Max Base (Salam)"
git config --global user.email "$EMAIL"
- name: Calculate checksums of original files
id: original_checksums
run: |
ls -l salam-wa.js salam-wa.wasm
sha256sum salam-wa.js > js-checksum.txt || echo "Error calculating checksum for salam-wa.js"
sha256sum salam-wa.wasm > wasm-checksum.txt || echo "Error calculating checksum for salam-wa.wasm"
echo "JS_CHECKSUM=$(cat js-checksum.txt | awk '{ print $1 }')" >> $GITHUB_ENV
echo "WASM_CHECKSUM=$(cat wasm-checksum.txt | awk '{ print $1 }')" >> $GITHUB_ENV
- name: Calculate checksums of new files in Salam-Editor
id: new_checksums
run: |
cd Salam-Editor/public/
ls -l salam-wa.js salam-wa.wasm
sha256sum salam-wa.js > js-checksum-editor.txt || echo "Error calculating checksum for salam-wa.js"
sha256sum salam-wa.wasm > wasm-checksum-editor.txt || echo "Error calculating checksum for salam-wa.wasm"
echo "JS_CHECKSUM_EDITOR=$(cat js-checksum-editor.txt | awk '{ print $1 }')" >> $GITHUB_ENV
echo "WASM_CHECKSUM_EDITOR=$(cat wasm-checksum-editor.txt | awk '{ print $1 }')" >> $GITHUB_ENV
- name: Commit and push changes if needed
if: ${{ env.JS_CHECKSUM != env.JS_CHECKSUM_EDITOR || env.WASM_CHECKSUM != env.WASM_CHECKSUM_EDITOR }}
run: |
cp ./salam-wa.js ./Salam-Editor/public/
cp ./salam-wa.wasm ./Salam-Editor/public/
cd Salam-Editor
sudo chown -R www-data:www-data *
git add public/salam-wa.js public/salam-wa.wasm
git commit -m "Release: Update WebAssembly files"
git push https://x-access-token:${{ secrets.USER_TOKEN }}@github.com/SalamLang/Salam-Editor.git