simplenote-cli 0.1.1__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.
- simplenote_cli-0.1.1/.github/workflows/ci.yml +75 -0
- simplenote_cli-0.1.1/.github/workflows/release.yml +265 -0
- simplenote_cli-0.1.1/.gitignore +4 -0
- simplenote_cli-0.1.1/CHANGELOG.md +20 -0
- simplenote_cli-0.1.1/Cargo.lock +2236 -0
- simplenote_cli-0.1.1/Cargo.toml +44 -0
- simplenote_cli-0.1.1/LICENSE +21 -0
- simplenote_cli-0.1.1/Makefile +46 -0
- simplenote_cli-0.1.1/PKG-INFO +220 -0
- simplenote_cli-0.1.1/README.md +202 -0
- simplenote_cli-0.1.1/docs/releases.md +118 -0
- simplenote_cli-0.1.1/prek.toml +36 -0
- simplenote_cli-0.1.1/pyproject.toml +29 -0
- simplenote_cli-0.1.1/schemas/clispec-v0.3.json +690 -0
- simplenote_cli-0.1.1/scripts/check-python-package.py +68 -0
- simplenote_cli-0.1.1/scripts/smoke-release.py +49 -0
- simplenote_cli-0.1.1/src/api.rs +423 -0
- simplenote_cli-0.1.1/src/auth.rs +122 -0
- simplenote_cli-0.1.1/src/cli.rs +506 -0
- simplenote_cli-0.1.1/src/error.rs +79 -0
- simplenote_cli-0.1.1/src/lib.rs +6 -0
- simplenote_cli-0.1.1/src/main.rs +101 -0
- simplenote_cli-0.1.1/src/schema.rs +147 -0
- simplenote_cli-0.1.1/tests/cli.rs +74 -0
- simplenote_cli-0.1.1/tests/conformance.rs +23 -0
- simplenote_cli-0.1.1/tests/protocol.rs +749 -0
- simplenote_cli-0.1.1/vership.toml +11 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ci-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
check:
|
|
18
|
+
name: Check (${{ matrix.os }})
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
os: [ubuntu-latest, macos-15, windows-latest]
|
|
23
|
+
runs-on: ${{ matrix.os }}
|
|
24
|
+
timeout-minutes: 20
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
|
|
30
|
+
with:
|
|
31
|
+
toolchain: stable
|
|
32
|
+
components: rustfmt, clippy
|
|
33
|
+
- run: cargo fmt -- --check
|
|
34
|
+
- run: cargo clippy --locked --all-targets -- -D warnings
|
|
35
|
+
- run: cargo test --locked
|
|
36
|
+
|
|
37
|
+
msrv:
|
|
38
|
+
name: Rust 1.90
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
timeout-minutes: 20
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
43
|
+
with:
|
|
44
|
+
persist-credentials: false
|
|
45
|
+
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
|
|
46
|
+
with:
|
|
47
|
+
toolchain: 1.90.0
|
|
48
|
+
- run: cargo check --locked
|
|
49
|
+
|
|
50
|
+
python-package:
|
|
51
|
+
name: Python package
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
timeout-minutes: 20
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
56
|
+
with:
|
|
57
|
+
persist-credentials: false
|
|
58
|
+
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
|
|
59
|
+
with:
|
|
60
|
+
toolchain: stable
|
|
61
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
62
|
+
with:
|
|
63
|
+
python-version: '3.12'
|
|
64
|
+
- run: make package-check
|
|
65
|
+
|
|
66
|
+
all-checks-passed:
|
|
67
|
+
name: All checks passed
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
needs: [check, msrv, python-package]
|
|
70
|
+
if: always()
|
|
71
|
+
steps:
|
|
72
|
+
- name: Require every check
|
|
73
|
+
env:
|
|
74
|
+
RESULTS: ${{ join(needs.*.result, ',') }}
|
|
75
|
+
run: test "$RESULTS" = 'success,success,success'
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v[0-9]*.[0-9]*.[0-9]*']
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
dry_run:
|
|
9
|
+
description: Build and validate without publishing
|
|
10
|
+
type: boolean
|
|
11
|
+
default: true
|
|
12
|
+
skip_pypi:
|
|
13
|
+
description: Skip an already published PyPI package when recovering a workflow
|
|
14
|
+
type: boolean
|
|
15
|
+
default: false
|
|
16
|
+
skip_crates_io:
|
|
17
|
+
description: Skip an already published crate when recovering a workflow
|
|
18
|
+
type: boolean
|
|
19
|
+
default: false
|
|
20
|
+
skip_github_release:
|
|
21
|
+
description: Skip an already published GitHub release when recovering a workflow
|
|
22
|
+
type: boolean
|
|
23
|
+
default: false
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
|
|
28
|
+
concurrency:
|
|
29
|
+
group: release
|
|
30
|
+
cancel-in-progress: false
|
|
31
|
+
|
|
32
|
+
defaults:
|
|
33
|
+
run:
|
|
34
|
+
shell: bash
|
|
35
|
+
|
|
36
|
+
jobs:
|
|
37
|
+
check:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
timeout-minutes: 20
|
|
40
|
+
outputs:
|
|
41
|
+
version: ${{ steps.metadata.outputs.version }}
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
44
|
+
with:
|
|
45
|
+
persist-credentials: false
|
|
46
|
+
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
|
|
47
|
+
with:
|
|
48
|
+
toolchain: stable
|
|
49
|
+
components: rustfmt, clippy
|
|
50
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
51
|
+
with:
|
|
52
|
+
python-version: '3.12'
|
|
53
|
+
- name: Check tag and package version
|
|
54
|
+
id: metadata
|
|
55
|
+
env:
|
|
56
|
+
DRY_RUN: ${{ inputs.dry_run }}
|
|
57
|
+
run: |
|
|
58
|
+
version=$(python3 -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["package"]["version"])')
|
|
59
|
+
if [[ "$GITHUB_EVENT_NAME" == 'push' || "$DRY_RUN" != 'true' ]]; then
|
|
60
|
+
test "$GITHUB_REF_TYPE" = 'tag'
|
|
61
|
+
test "$GITHUB_REF_NAME" = "v$version"
|
|
62
|
+
fi
|
|
63
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
64
|
+
- run: make check
|
|
65
|
+
- run: make package-check
|
|
66
|
+
- run: cargo publish --dry-run --locked
|
|
67
|
+
|
|
68
|
+
build:
|
|
69
|
+
needs: check
|
|
70
|
+
strategy:
|
|
71
|
+
fail-fast: false
|
|
72
|
+
matrix:
|
|
73
|
+
include:
|
|
74
|
+
- os: ubuntu-22.04
|
|
75
|
+
target: x86_64-unknown-linux-gnu
|
|
76
|
+
maturin_args: --compatibility manylinux_2_28 --zig
|
|
77
|
+
- os: ubuntu-22.04-arm
|
|
78
|
+
target: aarch64-unknown-linux-gnu
|
|
79
|
+
maturin_args: --compatibility manylinux_2_28 --zig
|
|
80
|
+
- os: macos-15
|
|
81
|
+
target: aarch64-apple-darwin
|
|
82
|
+
- os: macos-15
|
|
83
|
+
target: x86_64-apple-darwin
|
|
84
|
+
cross: true
|
|
85
|
+
- os: windows-latest
|
|
86
|
+
target: x86_64-pc-windows-msvc
|
|
87
|
+
extension: .exe
|
|
88
|
+
runs-on: ${{ matrix.os }}
|
|
89
|
+
timeout-minutes: 30
|
|
90
|
+
steps:
|
|
91
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
92
|
+
with:
|
|
93
|
+
persist-credentials: false
|
|
94
|
+
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
|
|
95
|
+
with:
|
|
96
|
+
toolchain: stable
|
|
97
|
+
targets: ${{ matrix.target }}
|
|
98
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
99
|
+
with:
|
|
100
|
+
python-version: '3.12'
|
|
101
|
+
- name: Build native binary wheel
|
|
102
|
+
run: uvx --from 'maturin>=1.8,<2' --with ziglang maturin build --locked --release --target ${{ matrix.target }} ${{ matrix.maturin_args }} --out dist/wheels
|
|
103
|
+
- name: Validate wheel metadata
|
|
104
|
+
run: uvx --from twine==6.2.0 twine check --strict dist/wheels/*.whl
|
|
105
|
+
- name: Install and smoke test wheel
|
|
106
|
+
if: ${{ !matrix.cross }}
|
|
107
|
+
env:
|
|
108
|
+
VERSION: ${{ needs.check.outputs.version }}
|
|
109
|
+
run: |
|
|
110
|
+
uv venv "$RUNNER_TEMP/wheel-smoke"
|
|
111
|
+
uv pip install --python "$RUNNER_TEMP/wheel-smoke" --no-index dist/wheels/*.whl
|
|
112
|
+
venv_bin="$RUNNER_TEMP/wheel-smoke/bin"
|
|
113
|
+
test -d "$venv_bin" || venv_bin="$RUNNER_TEMP/wheel-smoke/Scripts"
|
|
114
|
+
python scripts/smoke-release.py "$venv_bin/simplenote-cli${{ matrix.extension }}" "$VERSION"
|
|
115
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
116
|
+
with:
|
|
117
|
+
name: wheel-${{ matrix.target }}
|
|
118
|
+
path: dist/wheels/*.whl
|
|
119
|
+
if-no-files-found: error
|
|
120
|
+
- name: Smoke test binary
|
|
121
|
+
if: ${{ !matrix.cross }}
|
|
122
|
+
run: ./target/${{ matrix.target }}/release/simplenote-cli${{ matrix.extension }} --version
|
|
123
|
+
- name: Package binary and checksum
|
|
124
|
+
env:
|
|
125
|
+
VERSION: ${{ needs.check.outputs.version }}
|
|
126
|
+
TARGET: ${{ matrix.target }}
|
|
127
|
+
run: |
|
|
128
|
+
mkdir package
|
|
129
|
+
cp "target/$TARGET/release/simplenote-cli${{ matrix.extension }}" package/
|
|
130
|
+
cp LICENSE README.md package/
|
|
131
|
+
archive="simplenote-cli-v$VERSION-$TARGET.tar.gz"
|
|
132
|
+
tar -czf "$archive" -C package .
|
|
133
|
+
python - "$archive" <<'PYTHON'
|
|
134
|
+
import hashlib, pathlib, sys
|
|
135
|
+
archive = pathlib.Path(sys.argv[1])
|
|
136
|
+
pathlib.Path(str(archive) + '.sha256').write_text(hashlib.sha256(archive.read_bytes()).hexdigest() + ' ' + archive.name + '\n')
|
|
137
|
+
PYTHON
|
|
138
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
139
|
+
with:
|
|
140
|
+
name: binary-${{ matrix.target }}
|
|
141
|
+
path: simplenote-cli-*.tar.gz*
|
|
142
|
+
if-no-files-found: error
|
|
143
|
+
|
|
144
|
+
sdist:
|
|
145
|
+
needs: check
|
|
146
|
+
runs-on: ubuntu-latest
|
|
147
|
+
timeout-minutes: 15
|
|
148
|
+
steps:
|
|
149
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
150
|
+
with:
|
|
151
|
+
persist-credentials: false
|
|
152
|
+
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
|
|
153
|
+
with:
|
|
154
|
+
toolchain: stable
|
|
155
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
156
|
+
with:
|
|
157
|
+
python-version: '3.12'
|
|
158
|
+
- run: uvx --from 'maturin>=1.8,<2' maturin sdist --out dist/sdist
|
|
159
|
+
- run: uvx --from twine==6.2.0 twine check --strict dist/sdist/*.tar.gz
|
|
160
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
161
|
+
with:
|
|
162
|
+
name: sdist
|
|
163
|
+
path: dist/sdist/*.tar.gz
|
|
164
|
+
if-no-files-found: error
|
|
165
|
+
|
|
166
|
+
pypi:
|
|
167
|
+
needs: [check, build, sdist]
|
|
168
|
+
if: ${{ inputs.dry_run != true && inputs.skip_pypi != true }}
|
|
169
|
+
runs-on: ubuntu-latest
|
|
170
|
+
timeout-minutes: 15
|
|
171
|
+
environment:
|
|
172
|
+
name: pypi
|
|
173
|
+
url: https://pypi.org/p/simplenote-cli
|
|
174
|
+
permissions:
|
|
175
|
+
contents: read
|
|
176
|
+
id-token: write
|
|
177
|
+
steps:
|
|
178
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
179
|
+
with:
|
|
180
|
+
pattern: wheel-*
|
|
181
|
+
path: dist
|
|
182
|
+
merge-multiple: true
|
|
183
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
184
|
+
with:
|
|
185
|
+
name: sdist
|
|
186
|
+
path: dist
|
|
187
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
188
|
+
with:
|
|
189
|
+
packages-dir: dist
|
|
190
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
191
|
+
attestations: ${{ secrets.PYPI_API_TOKEN == '' }}
|
|
192
|
+
skip-existing: true
|
|
193
|
+
|
|
194
|
+
verify-pypi:
|
|
195
|
+
needs: [check, pypi]
|
|
196
|
+
if: ${{ inputs.dry_run != true && inputs.skip_pypi != true }}
|
|
197
|
+
runs-on: ubuntu-latest
|
|
198
|
+
timeout-minutes: 10
|
|
199
|
+
steps:
|
|
200
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
201
|
+
with:
|
|
202
|
+
persist-credentials: false
|
|
203
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
204
|
+
with:
|
|
205
|
+
python-version: '3.12'
|
|
206
|
+
- name: Install the public wheel and verify its CLI
|
|
207
|
+
env:
|
|
208
|
+
VERSION: ${{ needs.check.outputs.version }}
|
|
209
|
+
run: |
|
|
210
|
+
uv venv "$RUNNER_TEMP/pypi-smoke"
|
|
211
|
+
for attempt in 1 2 3 4 5 6; do
|
|
212
|
+
if uv pip install --python "$RUNNER_TEMP/pypi-smoke" --refresh --only-binary :all: --index-url https://pypi.org/simple "simplenote-cli==$VERSION"; then
|
|
213
|
+
break
|
|
214
|
+
fi
|
|
215
|
+
test "$attempt" -lt 6 || exit 1
|
|
216
|
+
sleep 10
|
|
217
|
+
done
|
|
218
|
+
python scripts/smoke-release.py "$RUNNER_TEMP/pypi-smoke/bin/simplenote-cli" "$VERSION"
|
|
219
|
+
|
|
220
|
+
crates:
|
|
221
|
+
needs: [check, build, sdist]
|
|
222
|
+
if: ${{ inputs.dry_run != true && inputs.skip_crates_io != true }}
|
|
223
|
+
runs-on: ubuntu-latest
|
|
224
|
+
timeout-minutes: 15
|
|
225
|
+
permissions:
|
|
226
|
+
contents: read
|
|
227
|
+
id-token: write
|
|
228
|
+
env:
|
|
229
|
+
BOOTSTRAP_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
230
|
+
steps:
|
|
231
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
232
|
+
with:
|
|
233
|
+
persist-credentials: false
|
|
234
|
+
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
|
|
235
|
+
with:
|
|
236
|
+
toolchain: stable
|
|
237
|
+
- name: Authenticate with Trusted Publishing after the initial crate exists
|
|
238
|
+
id: auth
|
|
239
|
+
if: env.BOOTSTRAP_TOKEN == ''
|
|
240
|
+
uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
|
|
241
|
+
- run: cargo publish --locked
|
|
242
|
+
env:
|
|
243
|
+
CARGO_REGISTRY_TOKEN: ${{ env.BOOTSTRAP_TOKEN || steps.auth.outputs.token }}
|
|
244
|
+
|
|
245
|
+
github-release:
|
|
246
|
+
needs: [check, build, sdist]
|
|
247
|
+
if: ${{ inputs.dry_run != true && inputs.skip_github_release != true }}
|
|
248
|
+
runs-on: ubuntu-latest
|
|
249
|
+
timeout-minutes: 10
|
|
250
|
+
permissions:
|
|
251
|
+
contents: write
|
|
252
|
+
steps:
|
|
253
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
254
|
+
with:
|
|
255
|
+
pattern: binary-*
|
|
256
|
+
path: artifacts
|
|
257
|
+
merge-multiple: true
|
|
258
|
+
- uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
|
|
259
|
+
with:
|
|
260
|
+
generate_release_notes: true
|
|
261
|
+
fail_on_unmatched_files: true
|
|
262
|
+
overwrite_files: false
|
|
263
|
+
files: |
|
|
264
|
+
artifacts/*.tar.gz
|
|
265
|
+
artifacts/*.tar.gz.sha256
|
|
@@ -0,0 +1,20 @@
|
|
|
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.1](https://github.com/rvben/simplenote-cli/compare/v0.1.0...v0.1.1) - 2026-11-10
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Distribute the native Rust CLI on PyPI with Linux, macOS, and Windows wheels
|
|
12
|
+
and a source distribution, sharing the Cargo version.
|
|
13
|
+
- Verify source builds, isolated wheel installs, and the public PyPI package.
|
|
14
|
+
- Include Windows x64 binaries in GitHub releases.
|
|
15
|
+
|
|
16
|
+
## [0.1.0] - 2026-11-10
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- add scriptable Simplenote CLI
|