Done with QBOOLSgit add -Agit add -Agit add -Agit add -Agit add -A! #24
This file contains hidden or 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
| name: Build Quantum C | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build (Linux) | |
| run: | | |
| g++ *.cpp -o qc-linux -std=c++20 -fconstexpr-ops-limit=100000000 | |
| - name: Upload Linux Binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: qc-linux | |
| path: qc-linux | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build (macOS) | |
| run: | | |
| clang++ *.cpp -o qc-macos -std=c++20 | |
| - name: Upload macOS Binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: qc-macos | |
| path: qc-macos | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build (Windows) | |
| run: | | |
| g++ *.cpp -o qc.exe -std=c++20 -fconstexpr-ops-limit=100000000 | |
| - name: Upload Windows Binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: qc-windows | |
| path: qc.exe | |
| build-wasm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Emscripten | |
| uses: mymindstorm/setup-emsdk@v13 | |
| with: | |
| version: 'latest' | |
| - name: Build (WASM) | |
| run: | | |
| emcc *.cpp -o qc.js -std=c++20 \ | |
| -s WASM=1 \ | |
| -s EXPORTED_FUNCTIONS='["_run_quantum_code"]' \ | |
| -s EXPORTED_RUNTIME_METHODS='["ccall","cwrap"]' \ | |
| -s ALLOW_MEMORY_GROWTH=1 \ | |
| -s MODULARIZE=1 \ | |
| -s EXPORT_NAME="QuantumC" \ | |
| -s NO_DISABLE_EXCEPTION_CATCHING \ | |
| -D__EMSCRIPTEN__ | |
| - name: Upload WASM Files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: qc-wasm | |
| path: | | |
| qc.js | |
| qc.wasm | |
| deploy-to-website: | |
| needs: build-wasm | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - name: Checkout website repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Youg-Otricked/learnhardcode | |
| token: ${{ secrets.PAT_TOKEN }} | |
| path: website | |
| - name: Download WASM artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: qc-wasm | |
| path: ./wasm-files | |
| - name: Copy WASM files to website repo | |
| run: | | |
| cp wasm-files/qc.js website/QuantumC/ | |
| cp wasm-files/qc.wasm website/QuantumC/ | |
| - name: Commit and push to website repo | |
| run: | | |
| cd website | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| git add QuantumC/qc.js QuantumC/qc.wasm | |
| git commit -m "Update Quantum C compiler [automated]" || echo "No changes to commit" | |
| git push |