From e54446545204f7039937486847f7eb8969667aeb Mon Sep 17 00:00:00 2001 From: David Irvine Date: Mon, 11 Nov 2024 10:32:53 +0000 Subject: [PATCH] fix: publishing --- .github/workflows/python-publish-client.yml | 6 ++--- .github/workflows/python-publish-node.yml | 29 ++++++++++++--------- autonomi/Cargo.toml | 2 +- sn_node/Cargo.toml | 2 +- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/python-publish-client.yml b/.github/workflows/python-publish-client.yml index 04e7b6cd74..db399deb47 100644 --- a/.github/workflows/python-publish-client.yml +++ b/.github/workflows/python-publish-client.yml @@ -39,7 +39,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --find-interpreter --compatibility manylinux2014 + args: --release --out dist --find-interpreter sccache: 'true' working-directory: ./autonomi - name: Upload wheels @@ -84,7 +84,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: - args: --release --out dist --find-interpreter --compatibility manylinux2014 + args: --release --out dist --find-interpreter sccache: 'true' working-directory: ./autonomi - name: Upload wheels @@ -137,7 +137,7 @@ jobs: with: target: ${{ matrix.target }} manylinux: "2014" - args: --release --out dist --find-interpreter --compatibility manylinux2014 + args: --release --out dist --find-interpreter sccache: 'true' working-directory: ./autonomi - name: Upload wheels diff --git a/.github/workflows/python-publish-node.yml b/.github/workflows/python-publish-node.yml index 7bc26c0a79..999c3349a3 100644 --- a/.github/workflows/python-publish-node.yml +++ b/.github/workflows/python-publish-node.yml @@ -32,14 +32,14 @@ jobs: run: | mkdir -p sn_node/python/safenode cat > sn_node/python/safenode/__init__.py << EOL - from ._safenode import * + from .safenode import * __version__ = "${{ github.ref_name }}" EOL - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist + args: --release --out dist --find-interpreter sccache: 'true' working-directory: ./sn_node - name: Upload wheels @@ -79,12 +79,12 @@ jobs: shell: cmd run: | if not exist "sn_node\python\safenode" mkdir sn_node\python\safenode - echo from ._safenode import * > sn_node\python\safenode\__init__.py + echo from .safenode import * > sn_node\python\safenode\__init__.py echo __version__ = "${{ github.ref_name }}" >> sn_node\python\safenode\__init__.py - name: Build wheels uses: PyO3/maturin-action@v1 with: - args: --release --out dist + args: --release --out dist --find-interpreter sccache: 'true' working-directory: ./sn_node - name: Upload wheels @@ -129,21 +129,17 @@ jobs: run: | mkdir -p sn_node/python/safenode cat > sn_node/python/safenode/__init__.py << EOL - from ._safenode import * + from .safenode import * __version__ = "${{ github.ref_name }}" EOL - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - manylinux: auto - args: --release --out dist + manylinux: "2014" + args: --release --out dist --find-interpreter sccache: 'true' working-directory: ./sn_node - before-script-linux: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source $HOME/.cargo/env - rustup component add rustfmt - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -173,7 +169,7 @@ jobs: run: | mkdir -p sn_node/python/safenode cat > sn_node/python/safenode/__init__.py << EOL - from ._safenode import * + from .safenode import * __version__ = "${{ github.ref_name }}" EOL - name: Build sdist @@ -221,6 +217,15 @@ jobs: echo "Final dist directory contents:" ls -la dist/ + - name: Check if version exists + run: | + VERSION="${{ github.ref_name }}" + VERSION="${VERSION#v}" # Remove 'v' prefix if present + if pip index versions safenode | grep -q "${VERSION}"; then + echo "Version ${VERSION} already exists on PyPI" + exit 1 + fi + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/autonomi/Cargo.toml b/autonomi/Cargo.toml index 1b9c3dde61..8b06cdebc3 100644 --- a/autonomi/Cargo.toml +++ b/autonomi/Cargo.toml @@ -3,7 +3,7 @@ authors = ["MaidSafe Developers "] description = "Autonomi client API" name = "autonomi" license = "GPL-3.0" -version = "0.2.31" +version = "0.2.32" edition = "2021" homepage = "https://maidsafe.net" readme = "README.md" diff --git a/sn_node/Cargo.toml b/sn_node/Cargo.toml index ed3eccf949..c65eeaea47 100644 --- a/sn_node/Cargo.toml +++ b/sn_node/Cargo.toml @@ -2,7 +2,7 @@ authors = ["MaidSafe Developers "] description = "Safe Node" name = "sn_node" -version = "0.112.4" +version = "0.112.41" edition = "2021" license = "GPL-3.0" homepage = "https://maidsafe.net"