copit 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.
Files changed (42) hide show
  1. copit-0.1.0/.editorconfig +12 -0
  2. copit-0.1.0/.github/workflows/build-binaries.yml +347 -0
  3. copit-0.1.0/.github/workflows/ci.yml +121 -0
  4. copit-0.1.0/.github/workflows/release.yml +129 -0
  5. copit-0.1.0/.gitignore +9 -0
  6. copit-0.1.0/.pre-commit-config.yaml +54 -0
  7. copit-0.1.0/CHANGELOG.md +13 -0
  8. copit-0.1.0/CONTRIBUTING.md +205 -0
  9. copit-0.1.0/Cargo.lock +3029 -0
  10. copit-0.1.0/Cargo.toml +33 -0
  11. copit-0.1.0/PKG-INFO +6 -0
  12. copit-0.1.0/README.md +161 -0
  13. copit-0.1.0/_typos.toml +2 -0
  14. copit-0.1.0/cliff.toml +49 -0
  15. copit-0.1.0/copit.toml +4 -0
  16. copit-0.1.0/install.sh +118 -0
  17. copit-0.1.0/pyproject.toml +20 -0
  18. copit-0.1.0/python/copit/__init__.py +1 -0
  19. copit-0.1.0/rust-toolchain.toml +2 -0
  20. copit-0.1.0/rustfmt.toml +1 -0
  21. copit-0.1.0/scripts/release.sh +76 -0
  22. copit-0.1.0/src/cli.rs +145 -0
  23. copit-0.1.0/src/commands/add.rs +177 -0
  24. copit-0.1.0/src/commands/common.rs +154 -0
  25. copit-0.1.0/src/commands/init.rs +26 -0
  26. copit-0.1.0/src/commands/mod.rs +17 -0
  27. copit-0.1.0/src/commands/remove.rs +70 -0
  28. copit-0.1.0/src/commands/sync.rs +36 -0
  29. copit-0.1.0/src/commands/update.rs +122 -0
  30. copit-0.1.0/src/config.rs +646 -0
  31. copit-0.1.0/src/lib.rs +59 -0
  32. copit-0.1.0/src/main.rs +22 -0
  33. copit-0.1.0/src/sources/github.rs +302 -0
  34. copit-0.1.0/src/sources/http.rs +100 -0
  35. copit-0.1.0/src/sources/mod.rs +373 -0
  36. copit-0.1.0/src/sources/zip.rs +170 -0
  37. copit-0.1.0/tests/cli/add.rs +383 -0
  38. copit-0.1.0/tests/cli/init.rs +34 -0
  39. copit-0.1.0/tests/cli/main.rs +47 -0
  40. copit-0.1.0/tests/cli/remove.rs +123 -0
  41. copit-0.1.0/tests/cli/sync.rs +210 -0
  42. copit-0.1.0/tests/cli/update.rs +291 -0
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ trim_trailing_whitespace = true
6
+ end_of_line = lf
7
+ indent_style = space
8
+ insert_final_newline = true
9
+ indent_size = 2
10
+
11
+ [*.{rs,py,pyi,toml}]
12
+ indent_size = 4
@@ -0,0 +1,347 @@
1
+ # Build copit on all platforms.
2
+ #
3
+ # Generates both wheels (for PyPI) and archived binaries (for GitHub releases).
4
+ #
5
+ # Called by release.yml workflow.
6
+ name: "Build binaries"
7
+
8
+ on:
9
+ workflow_call:
10
+ inputs:
11
+ ref:
12
+ description: "Git ref to checkout (tag, branch, or SHA)"
13
+ type: string
14
+ default: ""
15
+ pull_request:
16
+ paths:
17
+ - pyproject.toml
18
+ - .github/workflows/build-binaries.yml
19
+
20
+ concurrency:
21
+ group: build-binaries-${{ github.ref }}
22
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
23
+
24
+ permissions: {}
25
+
26
+ env:
27
+ PACKAGE_NAME: copit
28
+ PYTHON_VERSION: "3.12"
29
+ CARGO_INCREMENTAL: 0
30
+ CARGO_NET_RETRY: 10
31
+ CARGO_TERM_COLOR: always
32
+ RUSTUP_MAX_RETRIES: 10
33
+
34
+ jobs:
35
+ sdist:
36
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
40
+ with:
41
+ ref: ${{ inputs.ref || github.ref }}
42
+ persist-credentials: false
43
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
44
+ with:
45
+ python-version: ${{ env.PYTHON_VERSION }}
46
+ - name: "Build sdist"
47
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
48
+ with:
49
+ command: sdist
50
+ args: --out dist
51
+ - name: "Test sdist"
52
+ run: |
53
+ pip install dist/"${PACKAGE_NAME}"-*.tar.gz --force-reinstall
54
+ "${PACKAGE_NAME}" --help
55
+ - name: "Upload sdist"
56
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
57
+ with:
58
+ name: wheels-sdist
59
+ path: dist
60
+
61
+ macos-x86_64:
62
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
63
+ runs-on: macos-14
64
+ steps:
65
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
66
+ with:
67
+ ref: ${{ inputs.ref || github.ref }}
68
+ persist-credentials: false
69
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
70
+ with:
71
+ python-version: ${{ env.PYTHON_VERSION }}
72
+ architecture: x64
73
+ - name: "Build wheels - x86_64"
74
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
75
+ with:
76
+ target: x86_64
77
+ args: --release --locked --out dist
78
+ - name: "Upload wheels"
79
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
80
+ with:
81
+ name: wheels-macos-x86_64
82
+ path: dist
83
+ - name: "Archive binary"
84
+ run: |
85
+ TARGET=x86_64-apple-darwin
86
+ ARCHIVE_NAME=copit-$TARGET
87
+ ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
88
+
89
+ mkdir -p $ARCHIVE_NAME
90
+ cp target/$TARGET/release/copit $ARCHIVE_NAME/copit
91
+ tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
92
+ shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
93
+ - name: "Upload binary"
94
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
95
+ with:
96
+ name: artifacts-macos-x86_64
97
+ path: |
98
+ *.tar.gz
99
+ *.sha256
100
+
101
+ macos-aarch64:
102
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
103
+ runs-on: macos-14
104
+ steps:
105
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
106
+ with:
107
+ ref: ${{ inputs.ref || github.ref }}
108
+ persist-credentials: false
109
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
110
+ with:
111
+ python-version: ${{ env.PYTHON_VERSION }}
112
+ architecture: arm64
113
+ - name: "Build wheels - aarch64"
114
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
115
+ with:
116
+ target: aarch64
117
+ args: --release --locked --out dist
118
+ - name: "Test wheel - aarch64"
119
+ run: |
120
+ pip install dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
121
+ copit --help
122
+ - name: "Upload wheels"
123
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
124
+ with:
125
+ name: wheels-aarch64-apple-darwin
126
+ path: dist
127
+ - name: "Archive binary"
128
+ run: |
129
+ TARGET=aarch64-apple-darwin
130
+ ARCHIVE_NAME=copit-$TARGET
131
+ ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
132
+
133
+ mkdir -p $ARCHIVE_NAME
134
+ cp target/$TARGET/release/copit $ARCHIVE_NAME/copit
135
+ tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
136
+ shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
137
+ - name: "Upload binary"
138
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
139
+ with:
140
+ name: artifacts-aarch64-apple-darwin
141
+ path: |
142
+ *.tar.gz
143
+ *.sha256
144
+
145
+ windows:
146
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
147
+ runs-on: windows-latest
148
+ strategy:
149
+ matrix:
150
+ platform:
151
+ - target: x86_64-pc-windows-msvc
152
+ arch: x64
153
+ - target: aarch64-pc-windows-msvc
154
+ arch: x64
155
+ steps:
156
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
157
+ with:
158
+ ref: ${{ inputs.ref || github.ref }}
159
+ persist-credentials: false
160
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
161
+ with:
162
+ python-version: ${{ env.PYTHON_VERSION }}
163
+ architecture: ${{ matrix.platform.arch }}
164
+ - name: "Build wheels"
165
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
166
+ with:
167
+ target: ${{ matrix.platform.target }}
168
+ args: --release --locked --out dist
169
+ - name: "Test wheel"
170
+ if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
171
+ shell: bash
172
+ run: |
173
+ python -m pip install dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
174
+ "${PACKAGE_NAME}" --help
175
+ - name: "Upload wheels"
176
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
177
+ with:
178
+ name: wheels-${{ matrix.platform.target }}
179
+ path: dist
180
+ - name: "Archive binary"
181
+ shell: bash
182
+ run: |
183
+ ARCHIVE_FILE=copit-${{ matrix.platform.target }}.zip
184
+ 7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/copit.exe
185
+ sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
186
+ - name: "Upload binary"
187
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
188
+ with:
189
+ name: artifacts-${{ matrix.platform.target }}
190
+ path: |
191
+ *.zip
192
+ *.sha256
193
+
194
+ linux:
195
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
196
+ runs-on: ubuntu-latest
197
+ strategy:
198
+ matrix:
199
+ target:
200
+ - x86_64-unknown-linux-gnu
201
+ - i686-unknown-linux-gnu
202
+ steps:
203
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
204
+ with:
205
+ ref: ${{ inputs.ref || github.ref }}
206
+ persist-credentials: false
207
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
208
+ with:
209
+ python-version: ${{ env.PYTHON_VERSION }}
210
+ architecture: x64
211
+ - name: "Build wheels"
212
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
213
+ with:
214
+ target: ${{ matrix.target }}
215
+ manylinux: 2_17
216
+ args: --release --locked --out dist
217
+ - name: "Test wheel"
218
+ if: ${{ startsWith(matrix.target, 'x86_64') }}
219
+ run: |
220
+ pip install dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
221
+ "${PACKAGE_NAME}" --help
222
+ - name: "Upload wheels"
223
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
224
+ with:
225
+ name: wheels-${{ matrix.target }}
226
+ path: dist
227
+ - name: "Archive binary"
228
+ shell: bash
229
+ run: |
230
+ set -euo pipefail
231
+
232
+ TARGET=${{ matrix.target }}
233
+ ARCHIVE_NAME=copit-$TARGET
234
+ ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
235
+
236
+ mkdir -p $ARCHIVE_NAME
237
+ cp target/$TARGET/release/copit $ARCHIVE_NAME/copit
238
+ tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
239
+ shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
240
+ - name: "Upload binary"
241
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
242
+ with:
243
+ name: artifacts-${{ matrix.target }}
244
+ path: |
245
+ *.tar.gz
246
+ *.sha256
247
+
248
+ linux-cross:
249
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
250
+ runs-on: ubuntu-latest
251
+ strategy:
252
+ matrix:
253
+ platform:
254
+ - target: aarch64-unknown-linux-gnu
255
+ arch: aarch64
256
+ manylinux: 2_28
257
+ - target: armv7-unknown-linux-gnueabihf
258
+ arch: armv7
259
+ manylinux: 2_28
260
+ steps:
261
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
262
+ with:
263
+ ref: ${{ inputs.ref || github.ref }}
264
+ persist-credentials: false
265
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
266
+ with:
267
+ python-version: ${{ env.PYTHON_VERSION }}
268
+ - name: "Build wheels"
269
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
270
+ with:
271
+ target: ${{ matrix.platform.target }}
272
+ manylinux: ${{ matrix.platform.manylinux }}
273
+ args: --release --locked --out dist
274
+ - name: "Upload wheels"
275
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
276
+ with:
277
+ name: wheels-${{ matrix.platform.target }}
278
+ path: dist
279
+ - name: "Archive binary"
280
+ shell: bash
281
+ run: |
282
+ set -euo pipefail
283
+
284
+ TARGET=${{ matrix.platform.target }}
285
+ ARCHIVE_NAME=copit-$TARGET
286
+ ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
287
+
288
+ mkdir -p $ARCHIVE_NAME
289
+ cp target/$TARGET/release/copit $ARCHIVE_NAME/copit
290
+ tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
291
+ shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
292
+ - name: "Upload binary"
293
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
294
+ with:
295
+ name: artifacts-${{ matrix.platform.target }}
296
+ path: |
297
+ *.tar.gz
298
+ *.sha256
299
+
300
+ musllinux:
301
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
302
+ runs-on: ubuntu-latest
303
+ strategy:
304
+ matrix:
305
+ target:
306
+ - x86_64-unknown-linux-musl
307
+ - aarch64-unknown-linux-musl
308
+ steps:
309
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
310
+ with:
311
+ ref: ${{ inputs.ref || github.ref }}
312
+ persist-credentials: false
313
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
314
+ with:
315
+ python-version: ${{ env.PYTHON_VERSION }}
316
+ architecture: x64
317
+ - name: "Build wheels"
318
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
319
+ with:
320
+ target: ${{ matrix.target }}
321
+ manylinux: musllinux_1_2
322
+ args: --release --locked --out dist
323
+ - name: "Upload wheels"
324
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
325
+ with:
326
+ name: wheels-${{ matrix.target }}
327
+ path: dist
328
+ - name: "Archive binary"
329
+ shell: bash
330
+ run: |
331
+ set -euo pipefail
332
+
333
+ TARGET=${{ matrix.target }}
334
+ ARCHIVE_NAME=copit-$TARGET
335
+ ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
336
+
337
+ mkdir -p $ARCHIVE_NAME
338
+ cp target/$TARGET/release/copit $ARCHIVE_NAME/copit
339
+ tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
340
+ shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
341
+ - name: "Upload binary"
342
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
343
+ with:
344
+ name: artifacts-${{ matrix.target }}
345
+ path: |
346
+ *.tar.gz
347
+ *.sha256
@@ -0,0 +1,121 @@
1
+ name: CI
2
+
3
+ permissions: {}
4
+
5
+ on:
6
+ push:
7
+ branches: [main]
8
+ pull_request:
9
+ workflow_call:
10
+ workflow_dispatch:
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
14
+ cancel-in-progress: true
15
+
16
+ defaults:
17
+ run:
18
+ shell: bash
19
+
20
+ env:
21
+ CARGO_INCREMENTAL: 0
22
+ CARGO_NET_RETRY: 10
23
+ CARGO_TERM_COLOR: always
24
+ RUSTUP_MAX_RETRIES: 10
25
+
26
+ jobs:
27
+ prek:
28
+ name: "prek"
29
+ runs-on: ubuntu-latest
30
+ timeout-minutes: 10
31
+ steps:
32
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
33
+ with:
34
+ persist-credentials: false
35
+ - name: "Install Rust toolchain"
36
+ run: rustup component add rustfmt
37
+ - name: "Install uv"
38
+ uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
39
+ - name: "Cache prek"
40
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
41
+ with:
42
+ path: ~/.cache/prek
43
+ key: prek-${{ hashFiles('.pre-commit-config.yaml') }}
44
+ - name: "Run prek"
45
+ run: uvx prek run --all-files --show-diff-on-failure --color always
46
+
47
+ cargo-clippy:
48
+ name: "cargo clippy"
49
+ runs-on: ubuntu-latest
50
+ timeout-minutes: 20
51
+ steps:
52
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
53
+ with:
54
+ persist-credentials: false
55
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
56
+ with:
57
+ save-if: ${{ github.ref == 'refs/heads/main' }}
58
+ - name: "Install Rust toolchain"
59
+ run: rustup component add clippy
60
+ - name: "Clippy"
61
+ run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
62
+
63
+ cargo-test-linux:
64
+ name: "cargo test (linux)"
65
+ runs-on: ubuntu-latest
66
+ timeout-minutes: 20
67
+ steps:
68
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
69
+ with:
70
+ persist-credentials: false
71
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
72
+ with:
73
+ save-if: ${{ github.ref == 'refs/heads/main' }}
74
+ - name: "Install Rust toolchain"
75
+ run: rustup show
76
+ - name: "Run tests"
77
+ run: cargo test --all-features
78
+
79
+ cargo-test-other:
80
+ strategy:
81
+ matrix:
82
+ platform:
83
+ - windows-latest
84
+ - macos-latest
85
+ name: "cargo test (${{ matrix.platform }})"
86
+ runs-on: ${{ matrix.platform }}
87
+ timeout-minutes: 20
88
+ steps:
89
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
90
+ with:
91
+ persist-credentials: false
92
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
93
+ with:
94
+ save-if: ${{ github.ref == 'refs/heads/main' }}
95
+ - name: "Install Rust toolchain"
96
+ run: rustup show
97
+ - name: "Run tests"
98
+ run: cargo test --all-features
99
+
100
+ python-package:
101
+ name: "python package"
102
+ runs-on: ubuntu-latest
103
+ timeout-minutes: 20
104
+ steps:
105
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
106
+ with:
107
+ persist-credentials: false
108
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
109
+ with:
110
+ python-version: "3.12"
111
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
112
+ with:
113
+ save-if: ${{ github.ref == 'refs/heads/main' }}
114
+ - name: "Build wheels"
115
+ uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1
116
+ with:
117
+ args: --out dist
118
+ - name: "Test wheel"
119
+ run: |
120
+ pip install --force-reinstall --find-links dist copit
121
+ copit --help
@@ -0,0 +1,129 @@
1
+ # Release workflow:
2
+ # 1. Triggered by tag push (from release script) or manual workflow_dispatch
3
+ # 2. Builds binaries + wheels for all platforms
4
+ # 3. Creates GitHub Release with archives
5
+ # 4. Publishes to PyPI
6
+ # 5. Publishes to crates.io
7
+ name: Release
8
+
9
+ on:
10
+ push:
11
+ tags:
12
+ - "v*"
13
+ workflow_dispatch:
14
+ inputs:
15
+ tag:
16
+ description: "Release tag (e.g., v0.1.0)"
17
+ required: true
18
+ type: string
19
+
20
+ permissions: {}
21
+
22
+ env:
23
+ PACKAGE_NAME: copit
24
+ CARGO_INCREMENTAL: 0
25
+ CARGO_NET_RETRY: 10
26
+ CARGO_TERM_COLOR: always
27
+ RUSTUP_MAX_RETRIES: 10
28
+
29
+ jobs:
30
+ # Extract version from the git tag
31
+ plan:
32
+ name: "Plan release"
33
+ runs-on: ubuntu-latest
34
+ outputs:
35
+ tag: ${{ steps.version.outputs.tag }}
36
+ version: ${{ steps.version.outputs.version }}
37
+ steps:
38
+ - name: "Extract version from tag"
39
+ id: version
40
+ env:
41
+ INPUT_TAG: ${{ inputs.tag }}
42
+ run: |
43
+ TAG="${GITHUB_REF_NAME:-${INPUT_TAG}}"
44
+ VERSION="${TAG#v}"
45
+ echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
46
+ echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
47
+
48
+ # Build all platform binaries and wheels
49
+ build:
50
+ needs: plan
51
+ uses: ./.github/workflows/build-binaries.yml
52
+ with:
53
+ ref: ${{ needs.plan.outputs.tag }}
54
+
55
+ # Create GitHub Release
56
+ release:
57
+ name: "GitHub Release"
58
+ needs:
59
+ - plan
60
+ - build
61
+ runs-on: ubuntu-latest
62
+ permissions:
63
+ contents: write
64
+ steps:
65
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
66
+ with:
67
+ ref: ${{ needs.plan.outputs.tag }}
68
+ persist-credentials: false
69
+ - name: "Download artifacts"
70
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
71
+ with:
72
+ pattern: artifacts-*
73
+ path: artifacts
74
+ merge-multiple: true
75
+ - name: "Create GitHub Release"
76
+ env:
77
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78
+ RELEASE_TAG: ${{ needs.plan.outputs.tag }}
79
+ run: |
80
+ gh release create "${RELEASE_TAG}" \
81
+ --target "${{ github.sha }}" \
82
+ --title "copit ${RELEASE_TAG}" \
83
+ --generate-notes \
84
+ artifacts/*
85
+
86
+ # Publish to PyPI
87
+ publish-pypi:
88
+ name: "Publish to PyPI"
89
+ needs:
90
+ - plan
91
+ - build
92
+ - release
93
+ runs-on: ubuntu-latest
94
+ environment:
95
+ name: release
96
+ permissions:
97
+ id-token: write
98
+ steps:
99
+ - name: "Download wheels"
100
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
101
+ with:
102
+ pattern: wheels-*
103
+ path: wheels
104
+ merge-multiple: true
105
+ - name: "Install uv"
106
+ uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
107
+ with:
108
+ enable-cache: false
109
+ - name: "Publish to PyPI"
110
+ run: uv publish wheels/*
111
+
112
+ # Publish to crates.io
113
+ publish-crates:
114
+ name: "Publish to crates.io"
115
+ needs:
116
+ - plan
117
+ - release
118
+ runs-on: ubuntu-latest
119
+ steps:
120
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
121
+ with:
122
+ ref: ${{ needs.plan.outputs.tag }}
123
+ persist-credentials: false
124
+ - name: "Install Rust toolchain"
125
+ run: rustup show
126
+ - name: "Publish to crates.io"
127
+ env:
128
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
129
+ run: cargo publish
copit-0.1.0/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /target
2
+ *.swp
3
+ *.swo
4
+ .DS_Store
5
+ __pycache__/
6
+ *.pyc
7
+ *.egg-info/
8
+ dist/
9
+ .idea
@@ -0,0 +1,54 @@
1
+ fail_fast: false
2
+
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v5.0.0
6
+ hooks:
7
+ - id: check-merge-conflict
8
+ - id: trailing-whitespace
9
+ - id: end-of-file-fixer
10
+ - id: check-toml
11
+
12
+ - repo: https://github.com/abravalheri/validate-pyproject
13
+ rev: v0.25
14
+ hooks:
15
+ - id: validate-pyproject
16
+
17
+ - repo: https://github.com/crate-ci/typos
18
+ rev: v1.32.0
19
+ hooks:
20
+ - id: typos
21
+
22
+ - repo: local
23
+ hooks:
24
+ - id: rustfmt
25
+ name: rustfmt
26
+ entry: rustfmt
27
+ language: system
28
+ types: [rust]
29
+
30
+ - repo: https://github.com/rbubley/mirrors-prettier
31
+ rev: v3.5.3
32
+ hooks:
33
+ - id: prettier
34
+ types: [yaml]
35
+
36
+ - repo: https://github.com/zizmorcore/zizmor-pre-commit
37
+ rev: v1.6.0
38
+ hooks:
39
+ - id: zizmor
40
+
41
+ - repo: https://github.com/python-jsonschema/check-jsonschema
42
+ rev: 0.31.3
43
+ hooks:
44
+ - id: check-github-workflows
45
+
46
+ - repo: local
47
+ hooks:
48
+ - id: convco-check
49
+ name: convco-check
50
+ entry: convco check
51
+ language: system
52
+ stages: [commit-msg]
53
+ always_run: true
54
+ pass_filenames: false
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.1.0] - 2026-03-08
6
+
7
+ ### CI
8
+
9
+ - Add release script ([7d98b60](https://github.com/huynguyengl99/copit/commit/7d98b606bcfffe49d65ede40c68d489721b22e58))
10
+
11
+ ### Features
12
+
13
+ - Init copit project ([f86c7b1](https://github.com/huynguyengl99/copit/commit/f86c7b1d4b2e8cfd9f9fe30f76b437f98aaca608))