ecw2tiff 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,28 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ runner: [ubuntu-24.04, macos-14, windows-2022]
14
+ runs-on: ${{ matrix.runner }}
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Build and test (pure Rust)
18
+ run: |
19
+ cargo build --no-default-features
20
+ cargo test --no-default-features
21
+ - name: Clippy
22
+ if: matrix.runner == 'ubuntu-24.04'
23
+ run: cargo clippy --no-default-features -- -D warnings
24
+ - name: Check Python binding (compiles, lints)
25
+ if: matrix.runner == 'ubuntu-24.04'
26
+ run: |
27
+ cargo check --no-default-features --features python,webp
28
+ cargo clippy --no-default-features --features python,webp -- -D warnings
@@ -0,0 +1,94 @@
1
+ # On a v* tag: build Python wheels for each platform + an sdist and publish
2
+ # them to PyPI via trusted publishing (OIDC) — no API token or secret.
3
+ #
4
+ # Wheels are pure-Rust (--no-default-features --features python): JPEG uses
5
+ # the bundled jpeg-encoder rather than system libjpeg-turbo, so the wheels
6
+ # are self-contained and install anywhere. abi3 (py39) means one wheel per
7
+ # platform serves every Python >= 3.9.
8
+ #
9
+ # One-time setup on pypi.org (Account -> Publishing -> add a pending
10
+ # publisher): project "ecw2tiff", owner "itamarwe", repo "ecw2tiff",
11
+ # workflow "pypi.yml", environment "pypi".
12
+ name: pypi
13
+
14
+ on:
15
+ push:
16
+ tags: ["v*"]
17
+ workflow_dispatch: # build wheels without publishing (dry run)
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ wheels:
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ include:
28
+ - runner: macos-14
29
+ target: aarch64-apple-darwin
30
+ # Intel macOS runners are retired; cross-compile on the arm64 runner.
31
+ - runner: macos-14
32
+ target: x86_64-apple-darwin
33
+ - runner: ubuntu-24.04
34
+ target: x86_64-unknown-linux-gnu
35
+ - runner: ubuntu-24.04-arm
36
+ target: aarch64-unknown-linux-gnu
37
+ - runner: windows-2022
38
+ target: x86_64-pc-windows-msvc
39
+ runs-on: ${{ matrix.runner }}
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - name: Build wheel
43
+ uses: PyO3/maturin-action@v1
44
+ with:
45
+ target: ${{ matrix.target }}
46
+ # manylinux container for portable Linux wheels; ignored elsewhere.
47
+ manylinux: auto
48
+ args: >-
49
+ --release
50
+ --out dist
51
+ --no-default-features
52
+ --features python
53
+ - uses: actions/upload-artifact@v4
54
+ with:
55
+ name: wheels-${{ matrix.target }}
56
+ path: dist/*.whl
57
+ if-no-files-found: error
58
+
59
+ sdist:
60
+ runs-on: ubuntu-24.04
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - name: Build sdist
64
+ uses: PyO3/maturin-action@v1
65
+ with:
66
+ command: sdist
67
+ args: --out dist
68
+ - uses: actions/upload-artifact@v4
69
+ with:
70
+ name: sdist
71
+ path: dist/*.tar.gz
72
+ if-no-files-found: error
73
+
74
+ publish:
75
+ if: github.ref_type == 'tag'
76
+ needs: [wheels, sdist]
77
+ runs-on: ubuntu-24.04
78
+ environment: pypi
79
+ permissions:
80
+ id-token: write # OIDC for PyPI trusted publishing
81
+ steps:
82
+ - uses: actions/checkout@v4
83
+ - name: Check tag matches package version
84
+ run: |
85
+ version=$(grep -m1 '^version' Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')
86
+ [ "v$version" = "$GITHUB_REF_NAME" ] || {
87
+ echo "tag $GITHUB_REF_NAME != Cargo.toml version $version"; exit 1; }
88
+ - uses: actions/download-artifact@v4
89
+ with:
90
+ path: dist
91
+ merge-multiple: true
92
+ - uses: pypa/gh-action-pypi-publish@release/v1
93
+ with:
94
+ packages-dir: dist
@@ -0,0 +1,120 @@
1
+ # On a v* tag: build self-contained binaries for each platform, publish the
2
+ # npm platform packages + the ecw2tiff launcher package, and attach the
3
+ # binaries to a GitHub release.
4
+ #
5
+ # npm binaries are built with --no-default-features (pure Rust, no libjpeg-
6
+ # turbo) so they run anywhere with zero native dependencies.
7
+ #
8
+ # Publishing uses npm trusted publishing (OIDC) — no NPM_TOKEN secret. Each
9
+ # of the six packages must have this repo + workflow configured as a Trusted
10
+ # Publisher on npmjs.com (allowed action: "npm publish"). Trusted publishing
11
+ # cannot create a brand-new package, so the very first release is published
12
+ # locally with npm/first-publish.sh; run this workflow manually
13
+ # (workflow_dispatch) to produce the binaries for that.
14
+ name: release
15
+
16
+ on:
17
+ push:
18
+ tags: ["v*"]
19
+ workflow_dispatch: # build binaries only (first-release bootstrap)
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ jobs:
25
+ build:
26
+ strategy:
27
+ fail-fast: false
28
+ matrix:
29
+ include:
30
+ - target: aarch64-apple-darwin
31
+ runner: macos-14
32
+ npm_os: darwin
33
+ npm_cpu: arm64
34
+ # Intel macOS runners are retired; cross-compile on the arm64
35
+ # runner (tests for this target run under Rosetta elsewhere: the
36
+ # same code is tested natively on the other four targets).
37
+ - target: x86_64-apple-darwin
38
+ runner: macos-14
39
+ npm_os: darwin
40
+ npm_cpu: x64
41
+ cross: true
42
+ - target: x86_64-unknown-linux-musl
43
+ runner: ubuntu-24.04
44
+ npm_os: linux
45
+ npm_cpu: x64
46
+ - target: aarch64-unknown-linux-musl
47
+ runner: ubuntu-24.04-arm
48
+ npm_os: linux
49
+ npm_cpu: arm64
50
+ - target: x86_64-pc-windows-msvc
51
+ runner: windows-2022
52
+ npm_os: win32
53
+ npm_cpu: x64
54
+ runs-on: ${{ matrix.runner }}
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ - name: Install musl toolchain
58
+ if: contains(matrix.target, 'musl')
59
+ run: sudo apt-get update && sudo apt-get install -y musl-tools
60
+ - name: Build
61
+ run: |
62
+ rustup target add ${{ matrix.target }}
63
+ cargo build --release --no-default-features --target ${{ matrix.target }}
64
+ - name: Run tests
65
+ if: ${{ !matrix.cross }}
66
+ run: cargo test --no-default-features
67
+ - uses: actions/upload-artifact@v4
68
+ with:
69
+ name: bin-${{ matrix.npm_os }}-${{ matrix.npm_cpu }}
70
+ path: target/${{ matrix.target }}/release/ecw2tiff${{ matrix.npm_os == 'win32' && '.exe' || '' }}
71
+ if-no-files-found: error
72
+
73
+ publish:
74
+ if: github.ref_type == 'tag'
75
+ needs: build
76
+ runs-on: ubuntu-24.04
77
+ permissions:
78
+ id-token: write # OIDC for npm trusted publishing
79
+ contents: write # create the GitHub release
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+ - uses: actions/download-artifact@v4
83
+ with:
84
+ path: artifacts
85
+ - uses: actions/setup-node@v4
86
+ with:
87
+ node-version: 24
88
+ registry-url: https://registry.npmjs.org
89
+ - name: Update npm (trusted publishing needs >= 11.5.1)
90
+ run: npm install -g npm@latest && npm --version
91
+ - name: Check tag matches package version
92
+ run: |
93
+ version=$(node -p "require('./npm/ecw2tiff/package.json').version")
94
+ [ "v$version" = "$GITHUB_REF_NAME" ] || {
95
+ echo "tag $GITHUB_REF_NAME != package version $version"; exit 1; }
96
+ - name: Publish platform packages
97
+ run: |
98
+ set -euo pipefail
99
+ for pair in "darwin arm64" "darwin x64" "linux x64" "linux arm64" "win32 x64"; do
100
+ set -- $pair
101
+ exe=ecw2tiff; [ "$1" = win32 ] && exe=ecw2tiff.exe
102
+ node npm/make-platform-package.mjs "$1" "$2" "artifacts/bin-$1-$2/$exe" dist
103
+ npm publish --access public "./dist/ecw2tiff-$1-$2"
104
+ done
105
+ - name: Publish launcher package
106
+ run: npm publish --access public ./npm/ecw2tiff
107
+ - name: Create GitHub release
108
+ env:
109
+ GH_TOKEN: ${{ github.token }}
110
+ run: |
111
+ set -euo pipefail
112
+ mkdir release
113
+ for pair in "darwin arm64" "darwin x64" "linux x64" "linux arm64"; do
114
+ set -- $pair
115
+ cp "artifacts/bin-$1-$2/ecw2tiff" "release/ecw2tiff-$1-$2"
116
+ done
117
+ cp artifacts/bin-win32-x64/ecw2tiff.exe release/ecw2tiff-win32-x64.exe
118
+ (cd release && shasum -a 256 * > SHA256SUMS)
119
+ gh release create "$GITHUB_REF_NAME" release/* \
120
+ --title "$GITHUB_REF_NAME" --generate-notes
@@ -0,0 +1,9 @@
1
+ /target
2
+ /dist
3
+
4
+ # Python / maturin
5
+ *.so
6
+ *.pyd
7
+ __pycache__/
8
+ *.egg-info/
9
+ .venv/