Skip to content

Commit 5932c64

Browse files
committed
Merge branch 'release/0.4.0'
2 parents 58b47a2 + e571b74 commit 5932c64

File tree

143 files changed

+5003
-2207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+5003
-2207
lines changed

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, release/*, feature/*]
6+
pull_request:
7+
branches: [main, release/*]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
12+
13+
jobs:
14+
rust:
15+
name: Rust ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
submodules: true
25+
26+
- name: Install Rust
27+
uses: dtolnay/rust-toolchain@stable
28+
29+
- name: Cache cargo
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.cargo/registry
34+
~/.cargo/git
35+
target
36+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
37+
38+
- name: Check formatting
39+
run: cargo fmt --all -- --check
40+
41+
- name: Run clippy
42+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
43+
44+
- name: Build workspace
45+
run: cargo build --workspace --all-features
46+
47+
- name: Run tests
48+
run: cargo test --workspace --all-features
49+
50+
integration:
51+
name: Integration Tests
52+
runs-on: ubuntu-latest
53+
needs: [rust]
54+
55+
steps:
56+
- uses: actions/checkout@v4
57+
with:
58+
submodules: true
59+
60+
- name: Install Rust
61+
uses: dtolnay/rust-toolchain@stable
62+
63+
- name: Cache cargo
64+
uses: actions/cache@v4
65+
with:
66+
path: |
67+
~/.cargo/registry
68+
~/.cargo/git
69+
target
70+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
71+
72+
- name: Run integration tests
73+
run: cargo test --workspace --all-features --test '*'
74+
75+
- name: Run doc tests
76+
run: cargo test --workspace --doc

.github/workflows/main-hotfix.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Main Branch Hotfix
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
test-and-tag:
15+
name: Test and Create Hotfix Tag
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: true
22+
fetch-depth: 0
23+
24+
- name: Install Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
27+
- name: Cache cargo
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cargo/registry
32+
~/.cargo/git
33+
target
34+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
35+
36+
- name: Check formatting
37+
run: cargo fmt --all -- --check
38+
39+
- name: Run clippy
40+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
41+
42+
- name: Build workspace
43+
run: cargo build --workspace --all-features --release
44+
45+
- name: Run all tests
46+
run: cargo test --workspace --all-features
47+
48+
- name: Run integration tests
49+
run: cargo test --workspace --all-features --test '*'
50+
51+
- name: Extract version from Cargo.toml
52+
id: version
53+
run: |
54+
VERSION=$(grep -m 1 '^version = ' Cargo.toml | cut -d '"' -f 2)
55+
echo "version=$VERSION" >> $GITHUB_OUTPUT
56+
echo "Extracted version: v$VERSION"
57+
58+
- name: Check if tag exists
59+
id: check_tag
60+
run: |
61+
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
62+
echo "exists=true" >> $GITHUB_OUTPUT
63+
echo "Tag v${{ steps.version.outputs.version }} already exists"
64+
else
65+
echo "exists=false" >> $GITHUB_OUTPUT
66+
echo "Tag v${{ steps.version.outputs.version }} does not exist"
67+
fi
68+
69+
- name: Create and push tag
70+
if: steps.check_tag.outputs.exists == 'false'
71+
run: |
72+
git config user.name "github-actions[bot]"
73+
git config user.email "github-actions[bot]@users.noreply.github.com"
74+
git tag -a "v${{ steps.version.outputs.version }}" -m "Hotfix release v${{ steps.version.outputs.version }}"
75+
git push origin "v${{ steps.version.outputs.version }}"
76+
echo "Created and pushed tag v${{ steps.version.outputs.version }}"
77+
78+
- name: Skip tag creation
79+
if: steps.check_tag.outputs.exists == 'true'
80+
run: |
81+
echo "Tag v${{ steps.version.outputs.version }} already exists, skipping tag creation"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
publish:
13+
name: Publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: true
20+
21+
- name: Install Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
24+
- name: Cache cargo
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.cargo/registry
29+
~/.cargo/git
30+
target
31+
key: ${{ runner.os }}-cargo-publish-${{ hashFiles('**/Cargo.lock') }}
32+
33+
- name: Check formatting
34+
run: cargo fmt --all -- --check
35+
36+
- name: Run clippy
37+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
38+
39+
- name: Build workspace
40+
run: cargo build --workspace --all-features --release
41+
42+
- name: Run all tests
43+
run: cargo test --workspace --all-features
44+
45+
- name: Run integration tests
46+
run: cargo test --workspace --all-features --test '*'
47+
48+
# Publish in dependency order
49+
- name: Publish solverforge-core
50+
run: cargo publish -p solverforge-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
51+
- name: Wait for crates.io
52+
run: sleep 30
53+
54+
- name: Publish solverforge-macros
55+
run: cargo publish -p solverforge-macros --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
56+
- name: Wait for crates.io
57+
run: sleep 30
58+
59+
- name: Publish solverforge-scoring
60+
run: cargo publish -p solverforge-scoring --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
61+
- name: Wait for crates.io
62+
run: sleep 30
63+
64+
- name: Publish solverforge-config
65+
run: cargo publish -p solverforge-config --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
66+
- name: Wait for crates.io
67+
run: sleep 30
68+
69+
- name: Publish solverforge-solver
70+
run: cargo publish -p solverforge-solver --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
71+
- name: Wait for crates.io
72+
run: sleep 30
73+
74+
- name: Publish solverforge-benchmark
75+
run: cargo publish -p solverforge-benchmark --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
76+
- name: Wait for crates.io
77+
run: sleep 30
78+
79+
- name: Publish solverforge
80+
run: cargo publish -p solverforge --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/release.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to release (e.g., 0.2.0)'
11+
required: true
12+
13+
permissions:
14+
contents: write
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
19+
jobs:
20+
test:
21+
name: Run Tests
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
submodules: true
28+
29+
- name: Install Rust
30+
uses: dtolnay/rust-toolchain@stable
31+
32+
- name: Cache cargo
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
~/.cargo/registry
37+
~/.cargo/git
38+
target
39+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
40+
41+
- name: Check formatting
42+
run: cargo fmt --all -- --check
43+
44+
- name: Run clippy
45+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
46+
47+
- name: Build workspace
48+
run: cargo build --workspace --all-features --release
49+
50+
- name: Run all tests
51+
run: cargo test --workspace --all-features
52+
53+
- name: Run integration tests
54+
run: cargo test --workspace --all-features --test '*'
55+
56+
create-release:
57+
name: Create GitHub Release
58+
runs-on: ubuntu-latest
59+
needs: [test]
60+
outputs:
61+
version: ${{ steps.version.outputs.version }}
62+
63+
steps:
64+
- uses: actions/checkout@v4
65+
with:
66+
fetch-depth: 0
67+
68+
- name: Get version
69+
id: version
70+
run: |
71+
if [ -n "${{ github.event.inputs.version }}" ]; then
72+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
73+
else
74+
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
75+
fi
76+
77+
- name: Generate changelog
78+
id: changelog
79+
run: |
80+
# Get commits since last tag
81+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
82+
if [ -n "$PREV_TAG" ]; then
83+
CHANGELOG=$(git log --pretty=format:"* %s (%h)" $PREV_TAG..HEAD)
84+
else
85+
CHANGELOG=$(git log --pretty=format:"* %s (%h)" -20)
86+
fi
87+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
88+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
89+
echo "EOF" >> $GITHUB_OUTPUT
90+
91+
- name: Create Release
92+
uses: softprops/action-gh-release@v1
93+
with:
94+
name: v${{ steps.version.outputs.version }}
95+
body: |
96+
## What's Changed
97+
98+
${{ steps.changelog.outputs.changelog }}
99+
100+
## Installation
101+
102+
**Rust:**
103+
```toml
104+
[dependencies]
105+
solverforge-core = "${{ steps.version.outputs.version }}"
106+
```
107+
108+
**Python:**
109+
```bash
110+
pip install solverforge==${{ steps.version.outputs.version }}
111+
```
112+
113+
**Maven:**
114+
```xml
115+
<dependency>
116+
<groupId>org.solverforge</groupId>
117+
<artifactId>solverforge-wasm-service</artifactId>
118+
<version>${{ steps.version.outputs.version }}</version>
119+
</dependency>
120+
```
121+
draft: false
122+
prerelease: ${{ contains(steps.version.outputs.version, '-') }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ target
2121
#.idea/
2222

2323
CLAUDE.md
24+
25+
# OSM routing cache
26+
.osm_cache/

0 commit comments

Comments
 (0)