dotdiff 0.1.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.
@@ -0,0 +1,47 @@
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
+ - uses: taiki-e/install-action@nextest
32
+ - name: Run tests
33
+ run: make test
34
+
35
+ all-checks-passed:
36
+ name: All checks passed
37
+ runs-on: ubuntu-latest
38
+ needs: [lint, test]
39
+ if: always()
40
+ steps:
41
+ - name: Verify all checks passed
42
+ run: |
43
+ if [ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]; then
44
+ echo "Some checks failed or were cancelled"
45
+ exit 1
46
+ fi
47
+ echo "All checks passed"
@@ -0,0 +1,270 @@
1
+ name: Release
2
+
3
+ # Requires three repo secrets: CARGO_REGISTRY_TOKEN, PYPI_API_TOKEN, and
4
+ # HOMEBREW_TAP_DEPLOY_KEY. Bootstrap them in one step once the repo is on GitHub:
5
+ # clihatch secrets dotdiff # use --dry-run to preview
6
+
7
+ on:
8
+ push:
9
+ tags:
10
+ - 'v[0-9]*.[0-9]*.[0-9]*'
11
+ workflow_dispatch:
12
+ inputs:
13
+ dry_run:
14
+ description: 'Dry run mode (skip actual publishing)'
15
+ required: false
16
+ default: true
17
+ type: boolean
18
+ skip_crates_io:
19
+ description: 'Skip publishing to crates.io (if already published)'
20
+ required: false
21
+ default: false
22
+ type: boolean
23
+ skip_pypi:
24
+ description: 'Skip publishing to PyPI (if already published)'
25
+ required: false
26
+ default: false
27
+ type: boolean
28
+
29
+ permissions:
30
+ contents: write
31
+
32
+ env:
33
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34
+ # Avoid the intermittent "HTTP2 framing layer" curl errors when cargo fetches
35
+ # from crates.io on GitHub-hosted runners.
36
+ CARGO_HTTP_MULTIPLEXING: "false"
37
+
38
+ jobs:
39
+ test:
40
+ name: Run tests
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ - uses: dtolnay/rust-toolchain@stable
45
+ - uses: taiki-e/install-action@nextest
46
+ - name: Verify Cargo.lock is up to date
47
+ run: cargo check --locked
48
+ - name: Run tests
49
+ run: make test
50
+
51
+ build:
52
+ name: Build ${{ matrix.target }}
53
+ needs: test
54
+ timeout-minutes: 30
55
+ strategy:
56
+ fail-fast: false
57
+ matrix:
58
+ include:
59
+ - os: ubuntu-22.04
60
+ target: x86_64-unknown-linux-gnu
61
+ - os: ubuntu-22.04-arm
62
+ target: aarch64-unknown-linux-gnu
63
+ - os: macos-14
64
+ target: aarch64-apple-darwin
65
+ # Cross-compiled on Apple Silicon (Intel mac runners are scarce).
66
+ - os: macos-14
67
+ target: x86_64-apple-darwin
68
+ cross: true
69
+ runs-on: ${{ matrix.os }}
70
+ steps:
71
+ - uses: actions/checkout@v4
72
+
73
+ - uses: dtolnay/rust-toolchain@stable
74
+ with:
75
+ targets: ${{ matrix.target }}
76
+
77
+ # Portable wheels: maturin-action builds linux wheels inside a manylinux
78
+ # container and macOS wheels natively.
79
+ - name: Build wheel
80
+ uses: PyO3/maturin-action@v1
81
+ with:
82
+ target: ${{ matrix.target }}
83
+ args: --release --out dist
84
+ manylinux: auto
85
+
86
+ - name: Build binary
87
+ run: cargo build --release --target ${{ matrix.target }}
88
+
89
+ - name: Verify binary
90
+ # Skip for cross-compiled targets the runner cannot execute.
91
+ if: ${{ !matrix.cross }}
92
+ run: ./target/${{ matrix.target }}/release/dotdiff --version
93
+
94
+ - name: Create release archive
95
+ shell: bash
96
+ run: |
97
+ # GITHUB_REF_NAME is the tag on a release (v1.2.3) and the branch on
98
+ # a workflow_dispatch dry run (main); both are free of slashes.
99
+ VERSION="${GITHUB_REF_NAME}"
100
+ ARCHIVE_NAME="dotdiff-${VERSION}-${{ matrix.target }}"
101
+ mkdir -p release-package
102
+ cp "target/${{ matrix.target }}/release/dotdiff" release-package/dotdiff
103
+ tar -czf "${ARCHIVE_NAME}.tar.gz" -C release-package dotdiff
104
+ if [[ "${{ runner.os }}" == "macOS" ]]; then
105
+ shasum -a 256 "${ARCHIVE_NAME}.tar.gz" > "${ARCHIVE_NAME}.tar.gz.sha256"
106
+ else
107
+ sha256sum "${ARCHIVE_NAME}.tar.gz" > "${ARCHIVE_NAME}.tar.gz.sha256"
108
+ fi
109
+ rm -rf release-package
110
+
111
+ - name: Upload wheel
112
+ uses: actions/upload-artifact@v4
113
+ with:
114
+ name: wheel-${{ matrix.target }}
115
+ path: dist/*.whl
116
+
117
+ - name: Upload release archives
118
+ uses: actions/upload-artifact@v4
119
+ with:
120
+ name: release-${{ matrix.target }}
121
+ path: |
122
+ dotdiff-*-${{ matrix.target }}.tar.gz*
123
+
124
+ sdist:
125
+ name: Build source distribution
126
+ needs: test
127
+ runs-on: ubuntu-latest
128
+ steps:
129
+ - uses: actions/checkout@v4
130
+ - uses: astral-sh/setup-uv@v6
131
+ - name: Build sdist
132
+ run: uvx maturin sdist --out dist
133
+ - uses: actions/upload-artifact@v4
134
+ with:
135
+ name: sdist
136
+ path: dist/*.tar.gz
137
+
138
+ release:
139
+ runs-on: ubuntu-latest
140
+ needs: [build, sdist]
141
+ steps:
142
+ - uses: actions/checkout@v4
143
+ - uses: dtolnay/rust-toolchain@stable
144
+
145
+ - name: Publish to crates.io
146
+ if: ${{ inputs.dry_run != true && inputs.skip_crates_io != true }}
147
+ env:
148
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
149
+ run: cargo publish --locked
150
+
151
+ - name: Test crates.io publish (dry run)
152
+ if: ${{ inputs.dry_run == true && inputs.skip_crates_io != true }}
153
+ run: cargo publish --dry-run --locked
154
+
155
+ - name: Skip crates.io publishing
156
+ if: ${{ inputs.skip_crates_io == true }}
157
+ run: echo "Skipping crates.io publishing as requested"
158
+
159
+ - name: Install uv
160
+ uses: astral-sh/setup-uv@v6
161
+
162
+ - name: Download all artifacts
163
+ uses: actions/download-artifact@v4
164
+ with:
165
+ path: artifacts
166
+
167
+ - name: Publish to PyPI
168
+ if: ${{ inputs.dry_run != true && inputs.skip_pypi != true }}
169
+ run: uv publish artifacts/wheel-*/*.whl artifacts/sdist/*.tar.gz
170
+ env:
171
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
172
+
173
+ - name: Create Release
174
+ if: ${{ inputs.dry_run != true }}
175
+ uses: softprops/action-gh-release@v2
176
+ with:
177
+ generate_release_notes: true
178
+ files: |
179
+ artifacts/release-*/dotdiff-*.tar.gz
180
+ artifacts/release-*/dotdiff-*.tar.gz.sha256
181
+
182
+ - name: Dry Run Summary
183
+ if: ${{ inputs.dry_run == true }}
184
+ run: |
185
+ echo "Dry run complete. Artifacts built but nothing published."
186
+ find artifacts/release-* artifacts/wheel-* artifacts/sdist -type f | sort
187
+
188
+ update-homebrew:
189
+ needs: release
190
+ if: ${{ !inputs.dry_run }}
191
+ runs-on: ubuntu-latest
192
+ steps:
193
+ - uses: actions/download-artifact@v4
194
+ with:
195
+ path: /tmp/artifacts
196
+
197
+ - name: Compute SHA256 hashes
198
+ id: hashes
199
+ run: |
200
+ for target in x86_64-apple-darwin aarch64-apple-darwin x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
201
+ sha=$(cat /tmp/artifacts/release-${target}/dotdiff-${{ github.ref_name }}-${target}.tar.gz.sha256 | awk '{print $1}')
202
+ key=$(echo "${target}" | tr '-' '_')
203
+ echo "${key}=${sha}" >> "$GITHUB_OUTPUT"
204
+ done
205
+
206
+ - name: Update Homebrew formula
207
+ env:
208
+ HOMEBREW_TAP_DEPLOY_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }}
209
+ run: |
210
+ VERSION="${{ github.ref_name }}"
211
+ VERSION_NUM="${VERSION#v}"
212
+
213
+ cat > /tmp/dotdiff.rb << 'FORMULA'
214
+ class Dotdiff < Formula
215
+ desc "Semantic diff for JSON, YAML, TOML, and NDJSON: a structured, agent-friendly change-list instead of line noise."
216
+ homepage "https://github.com/rvben/dotdiff"
217
+ version "VERSION_NUM"
218
+ license "MIT"
219
+
220
+ on_macos do
221
+ if Hardware::CPU.arm?
222
+ url "https://github.com/rvben/dotdiff/releases/download/VERSION/dotdiff-VERSION-aarch64-apple-darwin.tar.gz"
223
+ sha256 "SHA_AARCH64_APPLE_DARWIN"
224
+ else
225
+ url "https://github.com/rvben/dotdiff/releases/download/VERSION/dotdiff-VERSION-x86_64-apple-darwin.tar.gz"
226
+ sha256 "SHA_X86_64_APPLE_DARWIN"
227
+ end
228
+ end
229
+
230
+ on_linux do
231
+ if Hardware::CPU.arm?
232
+ url "https://github.com/rvben/dotdiff/releases/download/VERSION/dotdiff-VERSION-aarch64-unknown-linux-gnu.tar.gz"
233
+ sha256 "SHA_AARCH64_UNKNOWN_LINUX_GNU"
234
+ else
235
+ url "https://github.com/rvben/dotdiff/releases/download/VERSION/dotdiff-VERSION-x86_64-unknown-linux-gnu.tar.gz"
236
+ sha256 "SHA_X86_64_UNKNOWN_LINUX_GNU"
237
+ end
238
+ end
239
+
240
+ def install
241
+ bin.install "dotdiff"
242
+ end
243
+
244
+ test do
245
+ system "#{bin}/dotdiff", "--version"
246
+ end
247
+ end
248
+ FORMULA
249
+
250
+ sed -i "s/VERSION_NUM/${VERSION_NUM}/g" /tmp/dotdiff.rb
251
+ sed -i "s/VERSION/${VERSION}/g" /tmp/dotdiff.rb
252
+ sed -i "s/SHA_AARCH64_APPLE_DARWIN/${{ steps.hashes.outputs.aarch64_apple_darwin }}/g" /tmp/dotdiff.rb
253
+ sed -i "s/SHA_X86_64_APPLE_DARWIN/${{ steps.hashes.outputs.x86_64_apple_darwin }}/g" /tmp/dotdiff.rb
254
+ sed -i "s/SHA_AARCH64_UNKNOWN_LINUX_GNU/${{ steps.hashes.outputs.aarch64_unknown_linux_gnu }}/g" /tmp/dotdiff.rb
255
+ sed -i "s/SHA_X86_64_UNKNOWN_LINUX_GNU/${{ steps.hashes.outputs.x86_64_unknown_linux_gnu }}/g" /tmp/dotdiff.rb
256
+
257
+ mkdir -p ~/.ssh
258
+ echo "$HOMEBREW_TAP_DEPLOY_KEY" > ~/.ssh/id_ed25519
259
+ chmod 600 ~/.ssh/id_ed25519
260
+ ssh-keyscan -t ed25519 github.com >> ~/.ssh/known_hosts 2>/dev/null
261
+
262
+ git clone git@github.com:rvben/homebrew-tap.git /tmp/tap
263
+ mkdir -p /tmp/tap/Formula
264
+ cp /tmp/dotdiff.rb /tmp/tap/Formula/dotdiff.rb
265
+ cd /tmp/tap
266
+ git config user.name "github-actions[bot]"
267
+ git config user.email "github-actions[bot]@users.noreply.github.com"
268
+ git add Formula/dotdiff.rb
269
+ git diff --cached --quiet || git commit -m "Update dotdiff to ${VERSION}"
270
+ git push
@@ -0,0 +1,4 @@
1
+ /target
2
+ /dist
3
+ .DS_Store
4
+ *.swp
@@ -0,0 +1,11 @@
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
+ ## [0.1.0] - 2026-06-21
8
+
9
+ ### Added
10
+
11
+ - implement semantic structured-data diff ([887f5af](https://github.com/rvben/dotdiff/commit/887f5afb8651e1be2ea3d3cf0c44f863e8a855c9))