dcap-qvl 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dcap-qvl might be problematic. Click here for more details.

Files changed (81) hide show
  1. dcap_qvl-0.3.0/.github/PUBLISHING.md +172 -0
  2. dcap_qvl-0.3.0/.github/dependabot.yml +45 -0
  3. dcap_qvl-0.3.0/.github/workflows/python-wheels.yml +235 -0
  4. dcap_qvl-0.3.0/.github/workflows/release.yml +163 -0
  5. dcap_qvl-0.3.0/.github/workflows/rust.yml +56 -0
  6. dcap_qvl-0.3.0/.gitignore +3 -0
  7. dcap_qvl-0.3.0/Cargo.lock +2730 -0
  8. dcap_qvl-0.3.0/Cargo.toml +99 -0
  9. dcap_qvl-0.3.0/LICENSE +21 -0
  10. dcap_qvl-0.3.0/Makefile +51 -0
  11. dcap_qvl-0.3.0/PKG-INFO +335 -0
  12. dcap_qvl-0.3.0/README.md +91 -0
  13. dcap_qvl-0.3.0/docs/README_Python.md +310 -0
  14. dcap_qvl-0.3.0/pyproject.toml +52 -0
  15. dcap_qvl-0.3.0/python/dcap_qvl/__init__.py +204 -0
  16. dcap_qvl-0.3.0/python/dcap_qvl/__init__.pyi +334 -0
  17. dcap_qvl-0.3.0/python-bindings/.gitignore +71 -0
  18. dcap_qvl-0.3.0/python-bindings/.pre-commit-config.yaml +17 -0
  19. dcap_qvl-0.3.0/python-bindings/README.md +118 -0
  20. dcap_qvl-0.3.0/python-bindings/docs/BUILDING.md +157 -0
  21. dcap_qvl-0.3.0/python-bindings/docs/PYTHON_TESTING.md +196 -0
  22. dcap_qvl-0.3.0/python-bindings/docs/README_Python.md +310 -0
  23. dcap_qvl-0.3.0/python-bindings/examples/basic_test.py +67 -0
  24. dcap_qvl-0.3.0/python-bindings/examples/python_example.py +63 -0
  25. dcap_qvl-0.3.0/python-bindings/pyproject.toml +52 -0
  26. dcap_qvl-0.3.0/python-bindings/python/dcap_qvl/__init__.py +204 -0
  27. dcap_qvl-0.3.0/python-bindings/python/dcap_qvl/__init__.pyi +334 -0
  28. dcap_qvl-0.3.0/python-bindings/scripts/build_wheels.py +270 -0
  29. dcap_qvl-0.3.0/python-bindings/scripts/build_wheels.sh +30 -0
  30. dcap_qvl-0.3.0/python-bindings/scripts/test_cross_versions.sh +251 -0
  31. dcap_qvl-0.3.0/python-bindings/scripts/test_installation.py +52 -0
  32. dcap_qvl-0.3.0/python-bindings/scripts/test_python_versions.sh +215 -0
  33. dcap_qvl-0.3.0/python-bindings/tests/test_collateral_api.py +155 -0
  34. dcap_qvl-0.3.0/python-bindings/tests/test_python_bindings.py +106 -0
  35. dcap_qvl-0.3.0/python-bindings/uv.lock +729 -0
  36. dcap_qvl-0.3.0/sample/quote-from-tappd.hex +1 -0
  37. dcap_qvl-0.3.0/sample/sgx_quote +0 -0
  38. dcap_qvl-0.3.0/sample/sgx_quote_collateral.json +11 -0
  39. dcap_qvl-0.3.0/sample/tdx-quote.hex +1 -0
  40. dcap_qvl-0.3.0/sample/tdx_quote +0 -0
  41. dcap_qvl-0.3.0/sample/tdx_quote_collateral.json +11 -0
  42. dcap_qvl-0.3.0/src/TrustedRootCA.der +0 -0
  43. dcap_qvl-0.3.0/src/collateral.rs +471 -0
  44. dcap_qvl-0.3.0/src/constants.rs +135 -0
  45. dcap_qvl-0.3.0/src/lib.rs +81 -0
  46. dcap_qvl-0.3.0/src/python.rs +204 -0
  47. dcap_qvl-0.3.0/src/quote.rs +490 -0
  48. dcap_qvl-0.3.0/src/tcb_info.rs +44 -0
  49. dcap_qvl-0.3.0/src/utils.rs +188 -0
  50. dcap_qvl-0.3.0/src/verify.rs +319 -0
  51. dcap_qvl-0.3.0/tests/esbuild/.gitignore +24 -0
  52. dcap_qvl-0.3.0/tests/esbuild/README.md +10 -0
  53. dcap_qvl-0.3.0/tests/esbuild/package.json +16 -0
  54. dcap_qvl-0.3.0/tests/esbuild/pnpm-lock.yaml +264 -0
  55. dcap_qvl-0.3.0/tests/esbuild/src/global.d.ts +2 -0
  56. dcap_qvl-0.3.0/tests/esbuild/src/index.html +12 -0
  57. dcap_qvl-0.3.0/tests/esbuild/src/main.ts +35 -0
  58. dcap_qvl-0.3.0/tests/esbuild/src/sample/tdx_quote +0 -0
  59. dcap_qvl-0.3.0/tests/esbuild/tsconfig.json +13 -0
  60. dcap_qvl-0.3.0/tests/js/.gitignore +2 -0
  61. dcap_qvl-0.3.0/tests/js/README.md +19 -0
  62. dcap_qvl-0.3.0/tests/js/get_collateral_node.js +24 -0
  63. dcap_qvl-0.3.0/tests/js/get_collateral_web.html +12 -0
  64. dcap_qvl-0.3.0/tests/js/get_collateral_web.js +31 -0
  65. dcap_qvl-0.3.0/tests/js/index.html +12 -0
  66. dcap_qvl-0.3.0/tests/js/verify_quote_node.js +33 -0
  67. dcap_qvl-0.3.0/tests/js/verify_quote_web.js +43 -0
  68. dcap_qvl-0.3.0/tests/snapshots/verify_quote__could_parse_sgx_quote.snap +1084 -0
  69. dcap_qvl-0.3.0/tests/snapshots/verify_quote__could_parse_tdx_quote.snap +1307 -0
  70. dcap_qvl-0.3.0/tests/verify_quote.rs +37 -0
  71. dcap_qvl-0.3.0/tests/vite/.gitignore +24 -0
  72. dcap_qvl-0.3.0/tests/vite/README.md +10 -0
  73. dcap_qvl-0.3.0/tests/vite/index.html +13 -0
  74. dcap_qvl-0.3.0/tests/vite/package.json +18 -0
  75. dcap_qvl-0.3.0/tests/vite/pnpm-lock.yaml +604 -0
  76. dcap_qvl-0.3.0/tests/vite/public/sample/tdx_quote +0 -0
  77. dcap_qvl-0.3.0/tests/vite/src/main.ts +41 -0
  78. dcap_qvl-0.3.0/tests/vite/src/style.css +96 -0
  79. dcap_qvl-0.3.0/tests/vite/src/vite-env.d.ts +1 -0
  80. dcap_qvl-0.3.0/tests/vite/tsconfig.json +25 -0
  81. dcap_qvl-0.3.0/tests/vite/vite.config.ts +5 -0
@@ -0,0 +1,172 @@
1
+ # Publishing Guide
2
+
3
+ This document explains how to publish dcap-qvl to various package repositories.
4
+
5
+ ## Python Package (PyPI)
6
+
7
+ ### Automated Publishing
8
+
9
+ The project includes GitHub Actions workflows for automated publishing:
10
+
11
+ #### 1. Via Git Tags (Automatic)
12
+ When you push a git tag starting with `v`, the `python-wheels.yml` workflow automatically:
13
+ - Builds wheels for all supported platforms
14
+ - Publishes to PyPI if the tag matches a version
15
+
16
+ ```bash
17
+ git tag v0.3.1
18
+ git push origin v0.3.1
19
+ ```
20
+
21
+ #### 2. Manual Publishing
22
+ Use the `publish-pypi.yml` workflow for manual control:
23
+
24
+ 1. Go to GitHub Actions → "Publish to PyPI"
25
+ 2. Click "Run workflow"
26
+ 3. Choose environment (testpypi or pypi)
27
+ 4. Optionally specify version
28
+ 5. Click "Run workflow"
29
+
30
+ ### Supported Platforms
31
+
32
+ The automated builds create wheels for:
33
+
34
+ **Linux (manylinux)**:
35
+ - x86_64
36
+ - x86 (32-bit)
37
+ - aarch64 (ARM64)
38
+
39
+ **Windows**:
40
+ - x64 (64-bit)
41
+ - x86 (32-bit)
42
+
43
+ **macOS**:
44
+ - x86_64 (Intel)
45
+ - aarch64 (Apple Silicon)
46
+
47
+ ### ABI3 Compatibility
48
+
49
+ All wheels are built with abi3 (stable ABI) enabled, meaning:
50
+ - One wheel works across multiple Python versions (3.8+)
51
+ - Smaller distribution size
52
+ - Better compatibility
53
+
54
+ ### Test Before Publishing
55
+
56
+ 1. **Test on TestPyPI first**:
57
+ ```bash
58
+ # Use the manual workflow with environment: testpypi
59
+ pip install -i https://test.pypi.org/simple/ dcap-qvl
60
+ ```
61
+
62
+ 2. **Local testing**:
63
+ ```bash
64
+ cd python-bindings
65
+ ./scripts/test_python_versions.sh
66
+ ```
67
+
68
+ ## Rust Crate (crates.io)
69
+
70
+ ### Automated Publishing
71
+
72
+ When you create a git tag, the `release.yml` workflow automatically publishes to crates.io.
73
+
74
+ ### Manual Publishing
75
+
76
+ ```bash
77
+ # Main library
78
+ cargo publish
79
+
80
+ # CLI tool
81
+ cd cli
82
+ cargo publish
83
+ ```
84
+
85
+ ## GitHub Releases
86
+
87
+ The `release.yml` workflow automatically creates GitHub releases with:
88
+ - Pre-built CLI binaries for multiple platforms
89
+ - Changelog generated from git commits
90
+ - Links to PyPI and crates.io packages
91
+
92
+ ## Environment Setup
93
+
94
+ ### Required Secrets
95
+
96
+ Configure these secrets in your GitHub repository:
97
+
98
+ 1. **CRATES_IO_TOKEN**: Token for publishing to crates.io
99
+ - Get from https://crates.io/settings/tokens
100
+ - Add to repository secrets
101
+
102
+ 2. **PyPI Publishing**: Uses OpenID Connect (no token needed)
103
+ - Configured with `id-token: write` permission
104
+ - Uses trusted publishing via GitHub Actions
105
+
106
+ ### Environments
107
+
108
+ Set up these GitHub Environments for PyPI publishing:
109
+
110
+ 1. **testpypi**: For testing releases
111
+ - URL: https://test.pypi.org/p/dcap-qvl
112
+ - Protection rules: None
113
+
114
+ 2. **pypi**: For production releases
115
+ - URL: https://pypi.org/p/dcap-qvl
116
+ - Protection rules: Required reviewers, deployment branches
117
+
118
+ ## Version Management
119
+
120
+ ### Python Package Version
121
+
122
+ Update version in `python-bindings/pyproject.toml`:
123
+ ```toml
124
+ [project]
125
+ version = "0.3.1"
126
+ ```
127
+
128
+ ### Rust Crate Version
129
+
130
+ Update version in root `Cargo.toml`:
131
+ ```toml
132
+ [package]
133
+ version = "0.3.1"
134
+ ```
135
+
136
+ ### CLI Version
137
+
138
+ Update version in `cli/Cargo.toml`:
139
+ ```toml
140
+ [package]
141
+ version = "0.3.1"
142
+ ```
143
+
144
+ ## Troubleshooting
145
+
146
+ ### Build Failures
147
+
148
+ 1. **Cross-compilation issues**: Check the maturin-action logs
149
+ 2. **Missing dependencies**: Ensure all features are properly configured
150
+ 3. **Test failures**: Run tests locally first
151
+
152
+ ### Publishing Issues
153
+
154
+ 1. **Duplicate version**: Use `skip-existing: true` in workflows
155
+ 2. **Permission denied**: Check GitHub environment protection rules
156
+ 3. **Missing wheels**: Verify all build jobs completed successfully
157
+
158
+ ### Testing Issues
159
+
160
+ 1. **Import errors**: Check that the wheel is compatible with the test environment
161
+ 2. **Async function failures**: Ensure tokio runtime is properly configured
162
+ 3. **ABI compatibility**: Test with multiple Python versions locally
163
+
164
+ ## Best Practices
165
+
166
+ 1. **Always test on TestPyPI first**
167
+ 2. **Use semantic versioning**
168
+ 3. **Update all version numbers consistently**
169
+ 4. **Test locally before pushing tags**
170
+ 5. **Review the generated changelog before release**
171
+ 6. **Monitor PyPI download statistics**
172
+ 7. **Keep dependencies up to date with Dependabot**
@@ -0,0 +1,45 @@
1
+ version: 2
2
+ updates:
3
+ # Rust dependencies
4
+ - package-ecosystem: "cargo"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ open-pull-requests-limit: 10
9
+ groups:
10
+ rust-dependencies:
11
+ patterns:
12
+ - "*"
13
+
14
+ # Rust CLI dependencies
15
+ - package-ecosystem: "cargo"
16
+ directory: "/cli"
17
+ schedule:
18
+ interval: "weekly"
19
+ open-pull-requests-limit: 5
20
+ groups:
21
+ cli-dependencies:
22
+ patterns:
23
+ - "*"
24
+
25
+ # Python dependencies in python-bindings
26
+ - package-ecosystem: "pip"
27
+ directory: "/python-bindings"
28
+ schedule:
29
+ interval: "weekly"
30
+ open-pull-requests-limit: 5
31
+ groups:
32
+ python-dependencies:
33
+ patterns:
34
+ - "*"
35
+
36
+ # GitHub Actions
37
+ - package-ecosystem: "github-actions"
38
+ directory: "/"
39
+ schedule:
40
+ interval: "weekly"
41
+ open-pull-requests-limit: 5
42
+ groups:
43
+ github-actions:
44
+ patterns:
45
+ - "*"
@@ -0,0 +1,235 @@
1
+ name: Build and Publish Python Wheels
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ branches:
8
+ - "python-bindings" # For testing
9
+ workflow_dispatch:
10
+
11
+ env:
12
+ CARGO_TERM_COLOR: always
13
+
14
+ jobs:
15
+ build-wheels:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v6
21
+ - name: Setup Python 3.8
22
+ run: uv python install 3.8
23
+ - uses: actions-rs/toolchain@v1
24
+ with:
25
+ profile: minimal
26
+ toolchain: stable
27
+ override: true
28
+ components: rustfmt, clippy
29
+ - name: Install Zig
30
+ run: |
31
+ curl -L https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz | tar -xJ
32
+ sudo mv zig-linux-x86_64-0.13.0 /opt/zig
33
+ sudo ln -sf /opt/zig/zig /usr/local/bin/zig
34
+ zig version
35
+ - name: Build Linux and macOS wheels with Zig
36
+ working-directory: python-bindings
37
+ run: |
38
+ uv sync
39
+ uv run python scripts/build_wheels.py \
40
+ --platforms linux-x86_64 linux-aarch64 linux-x86_64-musl linux-aarch64-musl macos-aarch64 \
41
+ --zig \
42
+ --install-targets \
43
+ --output-dir dist
44
+ - name: Upload wheels
45
+ uses: actions/upload-artifact@v4
46
+ with:
47
+ name: wheels-cross
48
+ path: python-bindings/dist
49
+
50
+ # Windows build using native runner
51
+ windows:
52
+ runs-on: windows-latest
53
+ env:
54
+ PYTHONIOENCODING: "utf-8"
55
+ PYTHONUTF8: "1"
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+ - name: Install uv
59
+ uses: astral-sh/setup-uv@v6
60
+ - name: Setup Python 3.8
61
+ run: uv python install 3.8
62
+ - uses: actions-rs/toolchain@v1
63
+ with:
64
+ profile: minimal
65
+ toolchain: stable
66
+ override: true
67
+ components: rustfmt, clippy
68
+ - name: Build Windows wheel
69
+ working-directory: python-bindings
70
+ run: |
71
+ uv sync
72
+ uv run python scripts/build_wheels.py --platforms windows-x64 --install-targets --output-dir dist
73
+ - name: Upload wheels
74
+ uses: actions/upload-artifact@v4
75
+ with:
76
+ name: wheels-windows
77
+ path: python-bindings/dist
78
+
79
+ # macOS Intel build using native runner (Zig cross-compilation has issues)
80
+ macos-intel:
81
+ runs-on: macos-13 # Intel runner
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+ - name: Install uv
85
+ uses: astral-sh/setup-uv@v6
86
+ - name: Setup Python 3.8
87
+ run: uv python install 3.8
88
+ - uses: actions-rs/toolchain@v1
89
+ with:
90
+ profile: minimal
91
+ toolchain: stable
92
+ override: true
93
+ components: rustfmt, clippy
94
+ - name: Build wheel natively
95
+ working-directory: python-bindings
96
+ run: |
97
+ uv sync
98
+ uv run python scripts/build_wheels.py \
99
+ --platforms macos-x86_64 \
100
+ --install-targets \
101
+ --output-dir dist
102
+ - name: Upload wheels
103
+ uses: actions/upload-artifact@v4
104
+ with:
105
+ name: wheels-macos-x86_64
106
+ path: python-bindings/dist
107
+
108
+ sdist:
109
+ runs-on: ubuntu-latest
110
+ steps:
111
+ - uses: actions/checkout@v4
112
+ - uses: actions-rs/toolchain@v1
113
+ with:
114
+ profile: minimal
115
+ toolchain: stable
116
+ override: true
117
+ components: rustfmt, clippy
118
+ - name: Build source distribution
119
+ uses: PyO3/maturin-action@v1
120
+ with:
121
+ command: sdist
122
+ args: --out dist
123
+ working-directory: python-bindings
124
+ - name: Upload source distribution
125
+ uses: actions/upload-artifact@v4
126
+ with:
127
+ name: wheels-sdist
128
+ path: python-bindings/dist
129
+
130
+ release:
131
+ name: Release
132
+ runs-on: ubuntu-latest
133
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
134
+ needs: [build-wheels, windows, macos-intel, sdist]
135
+ environment:
136
+ name: pypi
137
+ url: https://pypi.org/p/dcap-qvl
138
+ permissions:
139
+ id-token: write
140
+ steps:
141
+ - name: Download all artifacts
142
+ uses: actions/download-artifact@v4
143
+ with:
144
+ pattern: wheels-*
145
+ merge-multiple: true
146
+ path: dist
147
+ - name: List artifacts
148
+ run: ls -la dist/
149
+ - name: Publish to PyPI
150
+ uses: pypa/gh-action-pypi-publish@release/v1
151
+ with:
152
+ skip-existing: true
153
+ verbose: true
154
+
155
+ test-release:
156
+ name: Test Release
157
+ runs-on: ubuntu-latest
158
+ if: github.event_name == 'push' && github.ref == 'refs/heads/python-bindings'
159
+ needs: [build-wheels, windows, macos-intel, sdist]
160
+ environment:
161
+ name: testpypi
162
+ url: https://test.pypi.org/p/dcap-qvl
163
+ permissions:
164
+ id-token: write
165
+ steps:
166
+ - name: Download all artifacts
167
+ uses: actions/download-artifact@v4
168
+ with:
169
+ pattern: wheels-*
170
+ merge-multiple: true
171
+ path: dist
172
+ - name: List artifacts
173
+ run: ls -la dist/
174
+ - name: Publish to TestPyPI
175
+ uses: pypa/gh-action-pypi-publish@release/v1
176
+ with:
177
+ repository-url: https://test.pypi.org/legacy/
178
+ skip-existing: true
179
+ verbose: true
180
+
181
+ test-wheels:
182
+ name: Test Wheels
183
+ runs-on: ${{ matrix.os }}
184
+ needs: [build-wheels, windows, macos-intel]
185
+ if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/')
186
+ strategy:
187
+ matrix:
188
+ os: [ubuntu-latest, windows-latest, macos-latest]
189
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
190
+ exclude:
191
+ # Skip some combinations to reduce CI time
192
+ - os: windows-latest
193
+ python-version: "3.9"
194
+ - os: macos-latest
195
+ python-version: "3.9"
196
+ steps:
197
+ - uses: actions/checkout@v4
198
+ - name: Install uv
199
+ uses: astral-sh/setup-uv@v6
200
+ - name: Setup Python ${{ matrix.python-version }}
201
+ run: uv venv --python ${{ matrix.python-version }}
202
+ - name: Download wheels
203
+ uses: actions/download-artifact@v4
204
+ with:
205
+ pattern: wheels-*
206
+ merge-multiple: true
207
+ path: dist
208
+ - name: Find and install wheel
209
+ shell: bash
210
+ run: |
211
+ # Find the appropriate wheel for this platform and Python version
212
+ if [[ "${{ runner.os }}" == "Linux" ]]; then
213
+ WHEEL=$(find dist -name "*manylinux_*_x86_64*.whl" | head -n1)
214
+ elif [[ "${{ runner.os }}" == "Windows" ]]; then
215
+ WHEEL=$(find dist -name "*win_amd64*.whl" | head -n1)
216
+ elif [[ "${{ runner.os }}" == "macOS" ]]; then
217
+ if [[ "$(uname -m)" == "arm64" ]]; then
218
+ WHEEL=$(find dist -name "*macosx*arm64*.whl" | head -n1)
219
+ else
220
+ WHEEL=$(find dist -name "*macosx*x86_64*.whl" | head -n1)
221
+ fi
222
+ fi
223
+
224
+ if [[ -n "$WHEEL" ]]; then
225
+ echo "Installing wheel: $WHEEL"
226
+ uv pip install "$WHEEL"
227
+ else
228
+ echo "No suitable wheel found, installing from source"
229
+ cd python-bindings
230
+ uv add maturin
231
+ uv run maturin develop --features python
232
+ fi
233
+ - name: Test installation
234
+ working-directory: python-bindings
235
+ run: uv run python scripts/test_installation.py
@@ -0,0 +1,163 @@
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.3.1)"
11
+ required: true
12
+ type: string
13
+ prerelease:
14
+ description: "Is this a prerelease?"
15
+ required: false
16
+ type: boolean
17
+ default: false
18
+
19
+ env:
20
+ CARGO_TERM_COLOR: always
21
+
22
+ jobs:
23
+ create-release:
24
+ name: Create Release
25
+ runs-on: ubuntu-latest
26
+ outputs:
27
+ release-id: ${{ steps.create-release.outputs.id }}
28
+ upload-url: ${{ steps.create-release.outputs.upload_url }}
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 0
33
+
34
+ - name: Get version
35
+ id: get-version
36
+ run: |
37
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
38
+ VERSION="${{ github.event.inputs.version }}"
39
+ else
40
+ VERSION=${GITHUB_REF#refs/tags/v}
41
+ fi
42
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
43
+ echo "tag=v${VERSION}" >> $GITHUB_OUTPUT
44
+
45
+ - name: Generate changelog
46
+ id: changelog
47
+ run: |
48
+ # Simple changelog generation - you can enhance this
49
+ if git tag --list | grep -q "v"; then
50
+ PREVIOUS_TAG=$(git tag --list "v*" --sort=-version:refname | head -n2 | tail -n1)
51
+ if [[ -n "$PREVIOUS_TAG" ]]; then
52
+ CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s" --no-merges)
53
+ else
54
+ CHANGELOG=$(git log --pretty=format:"- %s" --no-merges)
55
+ fi
56
+ else
57
+ CHANGELOG=$(git log --pretty=format:"- %s" --no-merges)
58
+ fi
59
+
60
+ # Save changelog to file
61
+ cat > changelog.md << EOF
62
+ ## Changes in ${{ steps.get-version.outputs.tag }}
63
+
64
+ ${CHANGELOG}
65
+
66
+ ## Python Package
67
+
68
+ This release includes Python wheels for multiple platforms:
69
+ - Linux: x86_64, x86, aarch64, armv7, s390x, ppc64le
70
+ - Windows: x64, x86
71
+ - macOS: x86_64, aarch64 (Apple Silicon)
72
+
73
+ Install with: \`pip install dcap-qvl==${{ steps.get-version.outputs.version }}\`
74
+
75
+ ## Rust Crate
76
+
77
+ Add to your \`Cargo.toml\`:
78
+ \`\`\`toml
79
+ dcap-qvl = "${{ steps.get-version.outputs.version }}"
80
+ \`\`\`
81
+ EOF
82
+
83
+ - name: Create Release
84
+ id: create-release
85
+ uses: actions/create-release@v1
86
+ env:
87
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88
+ with:
89
+ tag_name: ${{ steps.get-version.outputs.tag }}
90
+ release_name: Release ${{ steps.get-version.outputs.tag }}
91
+ body_path: changelog.md
92
+ draft: false
93
+ prerelease: ${{ github.event.inputs.prerelease || false }}
94
+
95
+ build-rust:
96
+ name: Build Rust Binaries
97
+ needs: create-release
98
+ runs-on: ${{ matrix.os }}
99
+ strategy:
100
+ matrix:
101
+ include:
102
+ - os: ubuntu-latest
103
+ target: x86_64-unknown-linux-gnu
104
+ artifact-name: dcap-qvl-linux-x86_64
105
+ - os: ubuntu-latest
106
+ target: x86_64-unknown-linux-musl
107
+ artifact-name: dcap-qvl-linux-x86_64-musl
108
+ - os: windows-latest
109
+ target: x86_64-pc-windows-msvc
110
+ artifact-name: dcap-qvl-windows-x86_64.exe
111
+ - os: macos-latest
112
+ target: x86_64-apple-darwin
113
+ artifact-name: dcap-qvl-macos-x86_64
114
+ - os: macos-latest
115
+ target: aarch64-apple-darwin
116
+ artifact-name: dcap-qvl-macos-aarch64
117
+
118
+ steps:
119
+ - uses: actions/checkout@v4
120
+
121
+ - name: Install Rust
122
+ uses: dtolnay/rust-toolchain@stable
123
+ with:
124
+ targets: ${{ matrix.target }}
125
+
126
+ - name: Install musl tools
127
+ if: matrix.target == 'x86_64-unknown-linux-musl'
128
+ run: sudo apt-get install -y musl-tools
129
+
130
+ - name: Build CLI
131
+ run: |
132
+ cd cli
133
+ cargo build --release --target ${{ matrix.target }}
134
+
135
+ - name: Upload CLI Binary
136
+ uses: actions/upload-release-asset@v1
137
+ env:
138
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139
+ with:
140
+ upload_url: ${{ needs.create-release.outputs.upload-url }}
141
+ asset_path: cli/target/${{ matrix.target }}/release/dcap-qvl${{ contains(matrix.target, 'windows') && '.exe' || '' }}
142
+ asset_name: ${{ matrix.artifact-name }}
143
+ asset_content_type: application/octet-stream
144
+
145
+ publish-crates:
146
+ name: Publish to crates.io
147
+ needs: create-release
148
+ runs-on: ubuntu-latest
149
+ steps:
150
+ - uses: actions/checkout@v4
151
+
152
+ - name: Install Rust
153
+ uses: dtolnay/rust-toolchain@stable
154
+
155
+ - name: Publish dcap-qvl crate
156
+ run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
157
+ continue-on-error: true # Don't fail if already published
158
+
159
+ - name: Publish dcap-qvl-cli crate
160
+ run: |
161
+ cd cli
162
+ cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
163
+ continue-on-error: true # Don't fail if already published
@@ -0,0 +1,56 @@
1
+ name: Rust
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ pull_request:
7
+ branches: [ "master" ]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ build:
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Build
20
+ run: cargo build --verbose
21
+ - name: Run tests
22
+ run: cargo test --verbose
23
+
24
+ wasm:
25
+ name: Check WebAssembly target
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - name: Add wasm32 target
30
+ run: rustup target add wasm32-unknown-unknown
31
+ - name: Check wasm32 build
32
+ run: cargo check --target wasm32-unknown-unknown --features js
33
+
34
+ format:
35
+ name: Format code
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - name: Format code
40
+ run: cargo fmt --all -- --check
41
+
42
+ clippy:
43
+ name: Check code with clippy
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - name: Check code with clippy
48
+ run: cargo clippy --all
49
+
50
+ clippy-cli:
51
+ name: Check cli code with clippy
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - name: Check cli code with clippy
56
+ run: cd cli && cargo clippy --all
@@ -0,0 +1,3 @@
1
+ Cargo.lock
2
+ target/
3
+ .claude/