Skip to content

Commit fd8385c

Browse files
author
Adon Metcalfe
committed
Initial alpha release v0.1.0-alpha
0 parents  commit fd8385c

27 files changed

Lines changed: 2473 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [main, master]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup tools with mise
17+
uses: jdx/mise-action@v2
18+
with:
19+
install: true
20+
cache: true
21+
22+
- name: Setup project
23+
run: just ci-setup
24+
25+
- name: Run all checks
26+
run: just check
27+
28+
test:
29+
runs-on: ubuntu-latest
30+
needs: lint
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Setup tools with mise
35+
uses: jdx/mise-action@v2
36+
with:
37+
install: true
38+
cache: true
39+
40+
- name: Setup project
41+
run: just ci-setup
42+
43+
- name: Run unit tests
44+
run: just test-unit
45+
46+
build-vendor:
47+
strategy:
48+
matrix:
49+
include:
50+
- os: ubuntu-latest
51+
platform: linux-x64
52+
- os: ubuntu-latest
53+
platform: linux-arm64
54+
- os: macos-latest
55+
platform: darwin-arm64
56+
- os: macos-13
57+
platform: darwin-x64
58+
- os: windows-latest
59+
platform: win32-x64
60+
runs-on: ${{ matrix.os }}
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Setup tools with mise
65+
uses: jdx/mise-action@v2
66+
with:
67+
install: true
68+
cache: true
69+
70+
- name: Build vendor bundle
71+
shell: bash
72+
run: just ci-build-vendor ${{ matrix.platform }}
73+
74+
- name: Upload vendor artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: vendor-${{ matrix.platform }}
78+
path: mlnative/_vendor/${{ matrix.platform }}/
79+
retention-days: 1
80+
81+
build-package:
82+
needs: [test, build-vendor]
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Download all vendor artifacts
88+
uses: actions/download-artifact@v4
89+
with:
90+
path: mlnative/_vendor/
91+
pattern: vendor-*
92+
merge-multiple: false
93+
94+
- name: Organize vendor directories
95+
run: |
96+
for dir in mlnative/_vendor/vendor-*; do
97+
platform=$(basename "$dir" | sed 's/vendor-//')
98+
mv "$dir" "mlnative/_vendor/$platform"
99+
done
100+
101+
- name: Setup tools with mise
102+
uses: jdx/mise-action@v2
103+
with:
104+
install: true
105+
cache: true
106+
107+
- name: Build package
108+
run: just ci-build
109+
110+
- name: Upload package artifacts
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: dist
114+
path: dist/
115+
retention-days: 5
116+
117+
publish-testpypi:
118+
needs: build-package
119+
runs-on: ubuntu-latest
120+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
121+
environment:
122+
name: testpypi
123+
url: https://test.pypi.org/p/mlnative
124+
permissions:
125+
id-token: write
126+
steps:
127+
- name: Download package artifacts
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: dist
131+
path: dist/
132+
133+
- name: Publish to TestPyPI
134+
uses: pypa/gh-action-pypi-publish@release/v1
135+
with:
136+
repository-url: https://test.pypi.org/legacy/
137+
138+
publish-pypi:
139+
needs: [build-package, publish-testpypi]
140+
runs-on: ubuntu-latest
141+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
142+
environment:
143+
name: pypi
144+
url: https://pypi.org/p/mlnative
145+
permissions:
146+
id-token: write
147+
steps:
148+
- name: Download package artifacts
149+
uses: actions/download-artifact@v4
150+
with:
151+
name: dist
152+
path: dist/
153+
154+
- name: Publish to PyPI
155+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual environments
24+
venv/
25+
ENV/
26+
env/
27+
.venv
28+
29+
# IDE
30+
.vscode/
31+
.idea/
32+
*.swp
33+
*.swo
34+
*~
35+
36+
# Testing
37+
.pytest_cache/
38+
.coverage
39+
htmlcov/
40+
41+
# OS
42+
.DS_Store
43+
Thumbs.db
44+
45+
# Output files from examples
46+
*.png
47+
*.jpg
48+
*.jpeg
49+
50+
# Vendor binaries (these should be built separately)
51+
mlnative/_vendor/*/node_modules/
52+
mlnative/_vendor/*/build/
53+
*.node
54+
55+
# Temporary files
56+
*.tmp
57+
*.log
58+
59+
# Lock files
60+
uv.lock
61+
62+
# Symlinks for testing
63+
lib_symlinks/

0 commit comments

Comments
 (0)