Skip to content

Commit 57df6d4

Browse files
committed
Initial commit
0 parents  commit 57df6d4

37 files changed

Lines changed: 9487 additions & 0 deletions

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
rustflags = ["-C", "target-cpu=native"]

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/*
2+
!.cargo
3+
!Cargo.toml
4+
!Cargo.lock
5+
!src/
6+
!wit/

.github/workflows/dev-release.yaml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Dev Release
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
tags-ignore:
8+
- "**"
9+
10+
env:
11+
BIN_NAME: ${{ github.event.repository.name }}
12+
REGISTRY: ghcr.io
13+
14+
permissions:
15+
contents: write
16+
packages: write
17+
18+
jobs:
19+
build-dev:
20+
name: Build ${{ matrix.target }}
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- target: x86_64-unknown-linux-musl
27+
os: ubuntu-latest
28+
install_deps: sudo apt-get update && sudo apt-get install -y musl-tools
29+
- target: x86_64-unknown-linux-gnu
30+
os: ubuntu-latest
31+
install_deps: "false"
32+
- target: aarch64-unknown-linux-musl
33+
os: ubuntu-24.04-arm
34+
install_deps: sudo apt-get update && sudo apt-get install -y musl-tools
35+
- target: aarch64-unknown-linux-gnu
36+
os: ubuntu-24.04-arm
37+
install_deps: "false"
38+
- target: x86_64-apple-darwin
39+
os: macos-15-intel
40+
install_deps: "false"
41+
- target: aarch64-apple-darwin
42+
os: macos-latest
43+
install_deps: "false"
44+
- target: x86_64-pc-windows-msvc
45+
os: windows-latest
46+
install_deps: "false"
47+
- target: aarch64-pc-windows-msvc
48+
os: windows-11-arm
49+
install_deps: "false"
50+
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v6
54+
55+
- name: Install System Dependencies
56+
if: matrix.install_deps != 'false'
57+
run: ${{ matrix.install_deps }}
58+
59+
- name: Install Rust Toolchain
60+
uses: dtolnay/rust-toolchain@master
61+
with:
62+
toolchain: stable
63+
targets: ${{ matrix.target }}
64+
65+
- name: Rust Cache
66+
uses: swatinem/rust-cache@v2
67+
with:
68+
key: ${{ matrix.target }}
69+
70+
- name: Install cargo-edit
71+
uses: dtolnay/install@cargo-edit
72+
73+
- name: Set Dev Version
74+
shell: bash
75+
run: |
76+
BASE_VERSION=$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f 2)
77+
SHORT_SHA=$(git rev-parse --short HEAD)
78+
cargo set-version "${BASE_VERSION}-dev.${SHORT_SHA}"
79+
80+
- name: Build Binary
81+
run: cargo build --locked --release --target ${{ matrix.target }}
82+
83+
- name: Package Binary
84+
shell: bash
85+
run: |
86+
mkdir dist
87+
cp LICENSE dist/
88+
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
89+
cp "target/${{ matrix.target }}/release/${{ env.BIN_NAME }}.exe" dist/
90+
cd dist
91+
7z a "../${{ env.BIN_NAME }}-${{ matrix.target }}.zip" "${{ env.BIN_NAME }}.exe" LICENSE
92+
else
93+
cp "target/${{ matrix.target }}/release/${{ env.BIN_NAME }}" dist/
94+
cd dist
95+
tar -czf "../${{ env.BIN_NAME }}-${{ matrix.target }}.tar.gz" "${{ env.BIN_NAME }}" LICENSE
96+
fi
97+
98+
- name: Upload Artifact
99+
uses: actions/upload-artifact@v6
100+
with:
101+
name: binary-${{ matrix.target }}
102+
path: ${{ env.BIN_NAME }}-${{ matrix.target }}*
103+
retention-days: 1
104+
105+
release-dev:
106+
name: Update Dev Release
107+
needs: build-dev
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Download Artifacts
111+
uses: actions/download-artifact@v6
112+
with:
113+
path: artifacts
114+
merge-multiple: true
115+
116+
- name: Update Pre-Release
117+
uses: softprops/action-gh-release@v2
118+
with:
119+
tag_name: dev
120+
name: Development Build
121+
body: "Latest development build from master. Commit: ${{ github.sha }}"
122+
prerelease: true
123+
files: artifacts/*
124+
make_latest: false
125+
126+
docker-dev:
127+
name: Push Dev Docker
128+
runs-on: ubuntu-latest
129+
steps:
130+
- name: Checkout
131+
uses: actions/checkout@v6
132+
133+
- name: Install cargo-edit
134+
uses: dtolnay/install@cargo-edit
135+
136+
- name: Set Dev Version
137+
shell: bash
138+
run: |
139+
BASE_VERSION=$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f 2)
140+
SHORT_SHA=$(git rev-parse --short HEAD)
141+
cargo set-version "${BASE_VERSION}-dev.${SHORT_SHA}"
142+
143+
- name: Set up QEMU
144+
uses: docker/setup-qemu-action@v3
145+
146+
- name: Set up Docker Buildx
147+
uses: docker/setup-buildx-action@v3
148+
149+
- name: Log in to GHCR
150+
uses: docker/login-action@v3
151+
with:
152+
registry: ${{ env.REGISTRY }}
153+
username: ${{ github.repository_owner }}
154+
password: ${{ secrets.GITHUB_TOKEN }}
155+
156+
- name: Build and push
157+
uses: docker/build-push-action@v6
158+
with:
159+
context: .
160+
platforms: linux/amd64,linux/arm64
161+
push: true
162+
tags: |
163+
${{ env.REGISTRY }}/${{ github.repository }}:dev
164+
cache-from: type=gha
165+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)