clispec 0.1.2__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.
@@ -0,0 +1,46 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ lint:
15
+ name: Lint
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: dtolnay/rust-toolchain@stable
20
+ with:
21
+ components: rustfmt, clippy
22
+ - name: Run linting
23
+ run: make lint
24
+
25
+ test:
26
+ name: Test
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: dtolnay/rust-toolchain@stable
31
+ - name: Run tests
32
+ run: make test
33
+
34
+ all-checks-passed:
35
+ name: All checks passed
36
+ runs-on: ubuntu-latest
37
+ needs: [lint, test]
38
+ if: always()
39
+ steps:
40
+ - name: Verify all checks passed
41
+ run: |
42
+ if [ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]; then
43
+ echo "Some checks failed or were cancelled"
44
+ exit 1
45
+ fi
46
+ echo "All checks passed"
@@ -0,0 +1,275 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]*.[0-9]*.[0-9]*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ dry_run:
10
+ description: 'Dry run mode (skip actual publishing)'
11
+ required: false
12
+ default: true
13
+ type: boolean
14
+ skip_crates_io:
15
+ description: 'Skip publishing to crates.io (if already published)'
16
+ required: false
17
+ default: false
18
+ type: boolean
19
+ skip_pypi:
20
+ description: 'Skip publishing to PyPI (if already published)'
21
+ required: false
22
+ default: false
23
+ type: boolean
24
+
25
+ permissions:
26
+ contents: write
27
+
28
+ env:
29
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ jobs:
32
+ test:
33
+ name: Run tests
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+
38
+ - uses: dtolnay/rust-toolchain@stable
39
+
40
+ - name: Verify Cargo.lock is up to date
41
+ run: cargo check --locked
42
+
43
+ - name: Run tests
44
+ run: make test
45
+
46
+ build:
47
+ name: Build ${{ matrix.target }}
48
+ needs: test
49
+ strategy:
50
+ matrix:
51
+ include:
52
+ - os: ubuntu-latest
53
+ target: x86_64-unknown-linux-gnu
54
+ - os: ubuntu-latest
55
+ target: aarch64-unknown-linux-gnu
56
+ - os: macos-latest
57
+ target: x86_64-apple-darwin
58
+ - os: macos-latest
59
+ target: aarch64-apple-darwin
60
+ runs-on: ${{ matrix.os }}
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+
64
+ - uses: dtolnay/rust-toolchain@stable
65
+ with:
66
+ targets: ${{ matrix.target }}
67
+
68
+ - name: Install cross-compilation tools
69
+ if: matrix.target == 'aarch64-unknown-linux-gnu'
70
+ run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
71
+
72
+ - name: Install maturin
73
+ run: pip install maturin ziglang
74
+
75
+ - name: Build wheel
76
+ shell: bash
77
+ run: |
78
+ case "${{ matrix.target }}" in
79
+ *-gnu)
80
+ maturin build --release --target ${{ matrix.target }} --zig
81
+ ;;
82
+ *)
83
+ maturin build --release --target ${{ matrix.target }}
84
+ ;;
85
+ esac
86
+
87
+ - name: Build binary
88
+ env:
89
+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
90
+ run: cargo build --release --target ${{ matrix.target }}
91
+
92
+ - name: Verify binary
93
+ if: ${{ !contains(matrix.target, 'aarch64-unknown-linux') }}
94
+ shell: bash
95
+ run: ./target/${{ matrix.target }}/release/clispec --version
96
+
97
+ - name: Create release archive
98
+ shell: bash
99
+ run: |
100
+ VERSION=${GITHUB_REF#refs/tags/}
101
+ ARCHIVE_NAME="clispec-${VERSION}-${{ matrix.target }}"
102
+
103
+ mkdir -p release-package
104
+ cp "target/${{ matrix.target }}/release/clispec" release-package/clispec
105
+ tar -czf "${ARCHIVE_NAME}.tar.gz" -C release-package clispec
106
+
107
+ if [[ "${{ runner.os }}" == "macOS" ]]; then
108
+ shasum -a 256 "${ARCHIVE_NAME}.tar.gz" > "${ARCHIVE_NAME}.tar.gz.sha256"
109
+ else
110
+ sha256sum "${ARCHIVE_NAME}.tar.gz" > "${ARCHIVE_NAME}.tar.gz.sha256"
111
+ fi
112
+
113
+ rm -rf release-package
114
+
115
+ - name: Upload wheel
116
+ uses: actions/upload-artifact@v4
117
+ with:
118
+ path: target/wheels/*
119
+ name: wheel-${{ matrix.target }}
120
+
121
+ - name: Upload release archives
122
+ uses: actions/upload-artifact@v4
123
+ with:
124
+ path: |
125
+ clispec-*-${{ matrix.target }}.tar.gz*
126
+ name: release-${{ matrix.target }}
127
+
128
+ sdist:
129
+ name: Build source distribution
130
+ needs: test
131
+ runs-on: ubuntu-latest
132
+ steps:
133
+ - uses: actions/checkout@v4
134
+ - name: Install maturin
135
+ run: pip install maturin
136
+ - name: Build sdist
137
+ run: maturin sdist
138
+ - uses: actions/upload-artifact@v4
139
+ with:
140
+ name: sdist
141
+ path: target/wheels/*.tar.gz
142
+
143
+ release:
144
+ runs-on: ubuntu-latest
145
+ needs: [build, sdist]
146
+ steps:
147
+ - uses: actions/checkout@v4
148
+
149
+ - uses: dtolnay/rust-toolchain@stable
150
+
151
+ - name: Publish to crates.io
152
+ if: ${{ inputs.dry_run != true && inputs.skip_crates_io != true }}
153
+ env:
154
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
155
+ run: cargo publish --locked
156
+
157
+ - name: Test crates.io publish (dry run)
158
+ if: ${{ inputs.dry_run == true && inputs.skip_crates_io != true }}
159
+ run: |
160
+ echo "DRY RUN: Would publish to crates.io"
161
+ cargo publish --dry-run --locked
162
+
163
+ - name: Skip crates.io publishing
164
+ if: ${{ inputs.skip_crates_io == true }}
165
+ run: echo "Skipping crates.io publishing as requested"
166
+
167
+ - name: Install uv
168
+ uses: astral-sh/setup-uv@v6
169
+
170
+ - name: Download all artifacts
171
+ uses: actions/download-artifact@v4
172
+ with:
173
+ path: artifacts
174
+
175
+ - name: Publish to PyPI
176
+ if: ${{ inputs.dry_run != true && inputs.skip_pypi != true }}
177
+ run: uv publish artifacts/wheel-*/*.whl artifacts/sdist/*.tar.gz
178
+ env:
179
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
180
+
181
+ - name: Create Release
182
+ if: ${{ inputs.dry_run != true }}
183
+ uses: softprops/action-gh-release@v2
184
+ with:
185
+ generate_release_notes: true
186
+ files: |
187
+ artifacts/release-*/clispec-*.tar.gz
188
+ artifacts/release-*/clispec-*.tar.gz.sha256
189
+
190
+ - name: Dry Run Summary
191
+ if: ${{ inputs.dry_run == true }}
192
+ run: |
193
+ echo "Dry run complete. Artifacts built but nothing published."
194
+ echo "Archives:"
195
+ find artifacts/release-* -type f | sort
196
+
197
+ update-homebrew:
198
+ needs: release
199
+ if: ${{ !inputs.dry_run }}
200
+ runs-on: ubuntu-latest
201
+ steps:
202
+ - uses: actions/download-artifact@v4
203
+ with:
204
+ path: /tmp/artifacts
205
+
206
+ - name: Compute SHA256 hashes
207
+ id: hashes
208
+ run: |
209
+ for target in x86_64-apple-darwin aarch64-apple-darwin x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
210
+ sha=$(cat /tmp/artifacts/release-${target}/clispec-${{ github.ref_name }}-${target}.tar.gz.sha256 | awk '{print $1}')
211
+ key=$(echo "${target}" | tr '-' '_')
212
+ echo "${key}=${sha}" >> "$GITHUB_OUTPUT"
213
+ done
214
+
215
+ - name: Update Homebrew formula
216
+ env:
217
+ GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
218
+ run: |
219
+ VERSION="${{ github.ref_name }}"
220
+ VERSION_NUM="${VERSION#v}"
221
+
222
+ cat > /tmp/clispec.rb << 'FORMULA'
223
+ class Clispec < Formula
224
+ desc "Score CLI tools against The CLI Spec"
225
+ homepage "https://github.com/rvben/clispec-cli"
226
+ version "VERSION_NUM"
227
+ license "MIT"
228
+
229
+ on_macos do
230
+ if Hardware::CPU.arm?
231
+ url "https://github.com/rvben/clispec-cli/releases/download/VERSION/clispec-VERSION-aarch64-apple-darwin.tar.gz"
232
+ sha256 "SHA_AARCH64_APPLE_DARWIN"
233
+ else
234
+ url "https://github.com/rvben/clispec-cli/releases/download/VERSION/clispec-VERSION-x86_64-apple-darwin.tar.gz"
235
+ sha256 "SHA_X86_64_APPLE_DARWIN"
236
+ end
237
+ end
238
+
239
+ on_linux do
240
+ if Hardware::CPU.arm?
241
+ url "https://github.com/rvben/clispec-cli/releases/download/VERSION/clispec-VERSION-aarch64-unknown-linux-gnu.tar.gz"
242
+ sha256 "SHA_AARCH64_UNKNOWN_LINUX_GNU"
243
+ else
244
+ url "https://github.com/rvben/clispec-cli/releases/download/VERSION/clispec-VERSION-x86_64-unknown-linux-gnu.tar.gz"
245
+ sha256 "SHA_X86_64_UNKNOWN_LINUX_GNU"
246
+ end
247
+ end
248
+
249
+ def install
250
+ bin.install "clispec"
251
+ end
252
+
253
+ test do
254
+ system "#{bin}/clispec", "--version"
255
+ end
256
+ end
257
+ FORMULA
258
+
259
+ sed -i "s/VERSION_NUM/${VERSION_NUM}/g" /tmp/clispec.rb
260
+ sed -i "s/VERSION/${VERSION}/g" /tmp/clispec.rb
261
+ sed -i "s/SHA_AARCH64_APPLE_DARWIN/${{ steps.hashes.outputs.aarch64_apple_darwin }}/g" /tmp/clispec.rb
262
+ sed -i "s/SHA_X86_64_APPLE_DARWIN/${{ steps.hashes.outputs.x86_64_apple_darwin }}/g" /tmp/clispec.rb
263
+ sed -i "s/SHA_AARCH64_UNKNOWN_LINUX_GNU/${{ steps.hashes.outputs.aarch64_unknown_linux_gnu }}/g" /tmp/clispec.rb
264
+ sed -i "s/SHA_X86_64_UNKNOWN_LINUX_GNU/${{ steps.hashes.outputs.x86_64_unknown_linux_gnu }}/g" /tmp/clispec.rb
265
+
266
+ # Clone tap repo, update formula, push
267
+ git clone https://x-access-token:${GH_TOKEN}@github.com/rvben/homebrew-tap.git /tmp/tap
268
+ mkdir -p /tmp/tap/Formula
269
+ cp /tmp/clispec.rb /tmp/tap/Formula/clispec.rb
270
+ cd /tmp/tap
271
+ git config user.name "github-actions[bot]"
272
+ git config user.email "github-actions[bot]@users.noreply.github.com"
273
+ git add Formula/clispec.rb
274
+ git diff --cached --quiet || git commit -m "Update clispec to ${VERSION}"
275
+ git push
@@ -0,0 +1,3 @@
1
+ /target
2
+ .DS_Store
3
+ *.swp
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
+
7
+
8
+ ## [0.1.2](https://github.com/rvben/clispec-cli/compare/v0.1.1...v0.1.2) - 2026-04-03
9
+
10
+ ### Added
11
+
12
+ - add PyPI publishing via maturin ([1f86828](https://github.com/rvben/clispec-cli/commit/1f86828698e3b209f792e9199a9a62452dc92da6))
13
+
14
+ ## [0.1.1] - 2026-04-03
15
+
16
+ ### Added
17
+
18
+ - support --output/-o/--format as JSON flag alternatives ([407edaa](https://github.com/rvben/clispec-cli/commit/407edaaa6090a49d423109241cafaeccb22dae84))
19
+ - add integration tests and README ([6af0e86](https://github.com/rvben/clispec-cli/commit/6af0e86dfb966d272b49f9468a4a78e58e258d79))
20
+ - add schema command for self-compliance ([ab79875](https://github.com/rvben/clispec-cli/commit/ab7987592fa21ce9fb9f46aafa6139af59374639))
21
+ - add scorer and display modules ([194f73a](https://github.com/rvben/clispec-cli/commit/194f73a84f8c38c7204d00f5d22498baef909b4a))
22
+ - implement all 6 principle check modules ([945df11](https://github.com/rvben/clispec-cli/commit/945df110973406a1b77edd27f00c4e5657aadfb5))
23
+ - add check types and stub modules for all 6 principles ([dab9b47](https://github.com/rvben/clispec-cli/commit/dab9b47d449a091367a5100f5511cb70764d1cf9))
24
+ - add help parser for detecting flags and subcommands ([1cbff7b](https://github.com/rvben/clispec-cli/commit/1cbff7bf9397d002c8c84f23067f25e98f6ad045))
25
+ - add runner module for executing target binaries ([f1f6829](https://github.com/rvben/clispec-cli/commit/f1f68295ac4fd89e295ef9c7705319599ffaa724))
26
+ - scaffold clispec-cli project ([46dfb59](https://github.com/rvben/clispec-cli/commit/46dfb596430705d67fa12ff38e16fcc7ba6d3f10))