-
-
Notifications
You must be signed in to change notification settings - Fork 21
147 lines (139 loc) · 4.43 KB
/
language_bindings.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Language Bindings ✨
permissions:
contents: read
on:
push:
branches:
- 'master'
- 'dev'
paths:
- '**/language_bindings.yml'
- '**/bindings/**'
- '**/constants.nim'
jobs:
dependencies:
name: Install dependencies 🧩
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
nim_version:
- '2.0.8'
env:
TIMEOUT_EXIT_STATUS: 124
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.nimble
.nim_runtime
key: ${{ runner.os }}-nimble-v2-${{ hashFiles('*.nimble') }}
- uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ matrix.nim_version }}
- name: Install Dependencies 🔃
run: |
nimble refresh
nimble install -y -d
nimble install checksums jnim nimpy -y
python:
name: Python bindings 🐍
runs-on: ${{ matrix.os }}
needs: dependencies
strategy:
matrix:
os:
- ubuntu-latest
python_version:
- '3.x'
env:
TIMEOUT_EXIT_STATUS: 124
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.nimble
.nim_runtime
key: ${{ runner.os }}-nimble-v2-${{ hashFiles('*.nimble') }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Python Dependencies 🐍
run: |
python -m pip install --upgrade pip
pip install -U twine build packaging
- name: Python Bindings 🐍
run: |
export PATH=$PATH:$PWD/.nim_runtime/bin
nimble install checksums jnim nimpy -y
sudo apt-get install gcc-aarch64-linux-gnu
cd src
echo "Windows module"
echo "Win Module compiled with"
echo "nim c --app:lib --out:../bindings/python/happyx/happyx.pyd -d:useRealtimeGC --mm:arc --tlsEmulation:off --passL:-static --t:-flto --l:-flto --opt:speed --threads:off -d:release -d:httpx -d:export2py happyx"
echo "Linux amd64"
nim c --app:lib --out:../bindings/python/happyx/happyx_unix_amd64.so -d:useRealtimeGC --mm:arc -t:-flto -l:-flto --opt:speed --threads:off -d:release -d:happyxDebug -x:off -a:off -d:beast -d:export2py happyx
echo "Linux arm64"
nim c --app:lib --cpu:arm64 --out:../bindings/python/happyx/happyx_unix_arm64.so -d:useRealtimeGC --mm:arc -t:-flto -l:-flto --opt:speed --threads:off -d:release -d:happyxDebug -x:off -a:off -d:beast -d:export2py happyx
shell: bash
- name: Build Python Package 🏗
run: |
cd bindings/python
python -m build
# TODO:
# account recovery
- name: Publish Python package 📢
if: github.ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@8cdc2ab67c943c5edf5fd9ae1995546b4b550602
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: bindings/python/dist/
verbose: true
jvm:
name: JVM Bindings ☕
runs-on: ${{ matrix.os }}
needs: dependencies
strategy:
matrix:
os:
- ubuntu-latest
java_version:
- '16'
gradle_version:
- '7.4.2'
env:
TIMEOUT_EXIT_STATUS: 124
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.nimble
.nim_runtime
key: ${{ runner.os }}-nimble-v2-${{ hashFiles('*.nimble') }}
- uses: gradle/gradle-build-action@v3
id: setup-gradle
with:
gradle-version: ${{ matrix.gradle_version }}
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
architecture: x64
cache: 'gradle'
- name: JVM Bindings ☕
run: |
export PATH=$PATH:$PWD/.nim_runtime/bin
nimble install checksums jnim nimpy -y
cd src
echo "Unix module"
nim c -d:noSignalHandler -d:export2jvm -d:release -d:httpx --app:lib --threads:on --opt:speed --mm:arc --out:../bindings/java/src/main/resources/happyx.so happyx.nim
cd ..
- name: Build Java Project ☕
run: |
cd bindings/java
gradle build --scan