Skip to content

Commit 2bec063

Browse files
committed
initial commit
0 parents  commit 2bec063

33 files changed

Lines changed: 6255 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: mlugg/setup-zig@v2
19+
with:
20+
version: 0.15.0
21+
- name: Run Tests
22+
run: zig build test
23+
24+
build:
25+
name: Build
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v5
29+
- uses: mlugg/setup-zig@v2
30+
with:
31+
version: 0.15.0
32+
- name: Build Library
33+
run: zig build

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy VitePress site to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v5
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 24
30+
31+
- name: Setup Bun
32+
uses: oven-sh/setup-bun@v2
33+
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v4
36+
37+
- name: Install dependencies
38+
run: bun install
39+
working-directory: docs
40+
41+
- name: Build with VitePress
42+
run: bun run build
43+
working-directory: docs
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: docs/.vitepress/dist
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
needs: build
55+
runs-on: ubuntu-latest
56+
name: Deploy
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Release
2+
permissions:
3+
contents: write
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
test:
11+
name: Test on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: mlugg/setup-zig@v2
19+
with:
20+
version: 0.15.0
21+
- name: Run Tests
22+
run: zig build test
23+
24+
build-library:
25+
name: Build Library (${{ matrix.target }})
26+
needs: test
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
target:
31+
- x86_64-windows
32+
- x86-windows
33+
- x86_64-linux
34+
- x86-linux
35+
- aarch64-linux
36+
- x86_64-macos
37+
- aarch64-macos
38+
steps:
39+
- uses: actions/checkout@v5
40+
- uses: mlugg/setup-zig@v2
41+
with:
42+
version: 0.15.0
43+
44+
- name: Build Library
45+
run: zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.target }}
46+
47+
- name: Rename Artifact (Windows)
48+
if: contains(matrix.target, 'windows')
49+
run: mv zig-out/lib/zigantic.lib zigantic-${{ matrix.target }}.lib
50+
51+
- name: Rename Artifact (Unix)
52+
if: ${{ !contains(matrix.target, 'windows') }}
53+
run: mv zig-out/lib/libzigantic.a libzigantic-${{ matrix.target }}.a
54+
55+
- name: Upload Artifact
56+
run: gh release upload ${{ github.event.release.tag_name }} ${{ contains(matrix.target, 'windows') && format('zigantic-{0}.lib', matrix.target) || format('libzigantic-{0}.a', matrix.target) }}
57+
env:
58+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
59+
60+
update-release:
61+
name: Update Release Description
62+
needs: test
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v5
66+
67+
- name: Get Release URL
68+
id: get_url
69+
run: echo "url=https://github.com/${{ github.repository }}/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz" >> $GITHUB_OUTPUT
70+
71+
- uses: mlugg/setup-zig@v2
72+
with:
73+
version: 0.15.0
74+
75+
- name: Calculate Hash
76+
id: calc_hash
77+
run: |
78+
zig fetch --save ${{ steps.get_url.outputs.url }}
79+
HASH=$(grep '.hash =' build.zig.zon | cut -d '"' -f 2)
80+
echo "hash=$HASH" >> $GITHUB_OUTPUT
81+
82+
- name: Update Release Body
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
body: |
86+
${{ github.event.release.body }}
87+
88+
## Installation
89+
90+
```bash
91+
zig fetch --save https://github.com/${{ github.repository }}/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz
92+
```
93+
94+
Then in `build.zig`:
95+
96+
```zig
97+
const zigantic = b.dependency("zigantic", .{ .target = target, .optimize = optimize });
98+
exe.root_module.addImport("zigantic", zigantic.module("zigantic"));
99+
```
100+
101+
## Prebuilt Libraries
102+
103+
| Platform | File |
104+
|----------|------|
105+
| Windows x86_64 | [zigantic-x86_64-windows.lib](https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/zigantic-x86_64-windows.lib) |
106+
| Windows x86 | [zigantic-x86-windows.lib](https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/zigantic-x86-windows.lib) |
107+
| Linux x86_64 | [libzigantic-x86_64-linux.a](https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/libzigantic-x86_64-linux.a) |
108+
| Linux x86 | [libzigantic-x86-linux.a](https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/libzigantic-x86-linux.a) |
109+
| Linux aarch64 | [libzigantic-aarch64-linux.a](https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/libzigantic-aarch64-linux.a) |
110+
| macOS x86_64 | [libzigantic-x86_64-macos.a](https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/libzigantic-x86_64-macos.a) |
111+
| macOS aarch64 | [libzigantic-aarch64-macos.a](https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/libzigantic-aarch64-macos.a) |

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Zig
2+
zig-out/
3+
zig-cache/
4+
.zig-cache/
5+
*.obj
6+
*.o
7+
*.a
8+
*.lib
9+
*.pdb
10+
11+
# VitePress
12+
docs/node_modules/
13+
docs/.vitepress/dist/
14+
docs/.vitepress/cache/
15+
docs/bun.lockb
16+
17+
# Node
18+
node_modules/
19+
package-lock.json
20+
bun.lockb
21+
22+
# OS
23+
.DS_Store
24+
Thumbs.db
25+
Desktop.ini
26+
27+
# IDE
28+
.idea/
29+
.vscode/
30+
*.swp
31+
*.swo
32+
*~
33+
34+
# Logs
35+
*.log

CONTRIBUTING.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Contributing to zigantic
2+
3+
Thank you for your interest in contributing to zigantic!
4+
5+
## Development Setup
6+
7+
1. Clone the repository:
8+
9+
```bash
10+
git clone https://github.com/muhammad-fiaz/zigantic.git
11+
cd zigantic
12+
```
13+
14+
2. Ensure you have Zig 0.15.0 or later installed.
15+
16+
3. Run tests:
17+
```bash
18+
zig build test
19+
```
20+
21+
## Guidelines
22+
23+
- Follow Zig's style guidelines
24+
- Add tests for new functionality
25+
- Update documentation as needed
26+
- Keep commits focused and descriptive
27+
28+
## Pull Request Process
29+
30+
1. Fork the repository
31+
2. Create a feature branch
32+
3. Make your changes
33+
4. Run tests: `zig build test`
34+
5. Submit a pull request
35+
36+
## Code of Conduct
37+
38+
Be respectful and constructive in all interactions.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Muhammad Fiaz
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)