diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index ec87c84e..4282852d 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -22,8 +22,8 @@ jobs: include: - os: ubuntu-latest - os: windows-latest - - os: macos-13 - os: macos-14 + - os: macos-15-intel runs-on: ${{ matrix.os }} defaults: run: diff --git a/.github/workflows/rust-ecosystem-release.yml b/.github/workflows/rust-ecosystem-release.yml new file mode 100644 index 00000000..0d224073 --- /dev/null +++ b/.github/workflows/rust-ecosystem-release.yml @@ -0,0 +1,69 @@ +name: Rust Ecosystem Release + +on: + release: + types: [published] + workflow_dispatch: + inputs: + version: + description: Version shared by Rust, Node.js, and Python (for example, 0.7.0) + required: true + type: string + +permissions: + contents: read + actions: write + +jobs: + release: + if: github.event_name == 'workflow_dispatch' || startsWith(github.ref_name, 'rust-v') + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Determine version + id: version + shell: bash + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + VERSION="${{ inputs.version }}" + else + VERSION="${GITHUB_REF_NAME#rust-v}" + fi + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + + - name: Validate aligned versions + shell: bash + run: | + VERSION="${{ steps.version.outputs.version }}" + CARGO_VERSION="$(sed -n 's/^version = "\([^"]*\)"/\1/p' minipdf-rs/Cargo.toml | head -n 1)" + NODE_VERSION="$(node -p "require('./minipdf-node/package.json').version")" + PYTHON_VERSION="$(sed -n 's/^version = "\([^"]*\)"/\1/p' minipdf-python/pyproject.toml | head -n 1)" + if [ "$CARGO_VERSION" != "$VERSION" ]; then + echo "::error::Rust workspace version '$CARGO_VERSION' does not match release version '$VERSION'. Update minipdf-rs/Cargo.toml before releasing." + exit 1 + fi + if [ "$NODE_VERSION" != "$VERSION" ]; then + echo "::error::npm package version '$NODE_VERSION' does not match release version '$VERSION'. Update minipdf-node/package.json and package-lock.json before releasing." + exit 1 + fi + if [ "$PYTHON_VERSION" != "$VERSION" ]; then + echo "::error::Python package version '$PYTHON_VERSION' does not match release version '$VERSION'. Update minipdf-python/pyproject.toml and src/minipdf/__init__.py before releasing." + exit 1 + fi + + - name: Dispatch NPM publish + shell: bash + run: | + gh workflow run npm-publish.yml --ref "$GITHUB_SHA" \ + -f version="${{ steps.version.outputs.version }}" \ + -f mode=stage + + - name: Dispatch PyPI publish + shell: bash + run: | + gh workflow run pypi-publish.yml --ref "$GITHUB_SHA" \ + -f version="${{ steps.version.outputs.version }}" diff --git a/FEATURE_PARITY.md b/FEATURE_PARITY.md index 0fd03527..a991a854 100644 --- a/FEATURE_PARITY.md +++ b/FEATURE_PARITY.md @@ -51,6 +51,14 @@ Notes: the package backend, falling back to the pure Python renderers only when the extension is not importable. The capability matrix below describes the pure Python fallback. +- Node.js and Python versions follow the Rust core version. A `rust-vX.Y.Z` + release dispatches the NPM and PyPI publish workflows with the same version + through + [`rust-ecosystem-release.yml`](.github/workflows/rust-ecosystem-release.yml). + When bumping the Rust version, update `minipdf-node/package.json` (and + `package-lock.json`), `minipdf-python/pyproject.toml`, + `minipdf-python/src/minipdf/__init__.py`, and + `minipdf-python/native/Cargo.toml` in the same change. - `P` does not mean the same depth in every language. The detailed matrices below identify the important differences. - The public .NET page-size and margin overrides currently apply to DOCX. The diff --git a/minipdf-node/Cargo.lock b/minipdf-node/Cargo.lock index 2de1503e..f44fab1d 100644 --- a/minipdf-node/Cargo.lock +++ b/minipdf-node/Cargo.lock @@ -385,7 +385,7 @@ dependencies = [ [[package]] name = "minipdf-node" -version = "0.2.0" +version = "0.7.0" dependencies = [ "minipdf", "napi", diff --git a/minipdf-node/Cargo.toml b/minipdf-node/Cargo.toml index 42747466..fd389f34 100644 --- a/minipdf-node/Cargo.toml +++ b/minipdf-node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minipdf-node" -version = "0.2.0" +version = "0.7.0" edition = "2021" license = "Apache-2.0" repository = "https://github.com/mini-software/MiniPdf" diff --git a/minipdf-node/package-lock.json b/minipdf-node/package-lock.json index 95afe6b9..0361db93 100644 --- a/minipdf-node/package-lock.json +++ b/minipdf-node/package-lock.json @@ -1,12 +1,12 @@ { "name": "minipdf", - "version": "0.2.0", + "version": "0.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "minipdf", - "version": "0.2.0", + "version": "0.7.0", "license": "Apache-2.0", "devDependencies": { "@napi-rs/cli": "^2.18.4", diff --git a/minipdf-node/package.json b/minipdf-node/package.json index 8d27f817..3ca22d15 100644 --- a/minipdf-node/package.json +++ b/minipdf-node/package.json @@ -1,6 +1,6 @@ { "name": "minipdf", - "version": "0.2.0", + "version": "0.7.0", "description": "Native Node.js Office-to-PDF conversion powered by MiniPdf for Rust", "license": "Apache-2.0", "author": "MiniPdf contributors",