-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (97 loc) · 2.93 KB
/
Copy pathbuild.yml
File metadata and controls
115 lines (97 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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++23 -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++23 -stdlib=libstdc++
- 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++23 -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++23 -stdlib=libstdc++\
-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