Publish distribution 📦 to PyPI #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish distribution 📦 to PyPI | |
on: | |
workflow_dispatch: | |
jobs: | |
publish-to-testpypi: | |
environment: | |
name: pypi | |
url: https://pypi.org/p/python-snap7 | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
name: Publish distribution 📦 toPyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Download macOS artifacts" | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: osx-build-test-amd64.yml | |
path: . | |
- name: "Download Linux/amd64 artifacts" | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: linux-build-test-amd64.yml | |
path: . | |
- name: "Download Linux/arm64 artifacts" | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: linux-build-test-arm64.yml | |
path: . | |
- name: "Download Windows artifacts" | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: windows-build-test-amd64.yml | |
path: . | |
- name: "Download source artifacts" | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: source-build.yml | |
path: . | |
- name: Combine artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: dist | |
- name: show dist layout | |
run: find dist | |
- name: Publish distribution 📦 to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
test-pypi-packages: | |
runs-on: ${{ matrix.os }} | |
needs: publish-to-testpypi | |
strategy: | |
matrix: | |
os: ["ubuntu-24.04"," ubuntu-22.04", "ubuntu-20.04", "macos-13", "macos-14", "macos-15"] | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install python-snap7 | |
run: | | |
python3 -m venv venv | |
venv/bin/pip install --upgrade pip | |
venv/bin/pip install --extra-index-url https://test.pypi.org/simple/ python-snap7[test] | |
test-pypi-package-windows: | |
runs-on: ${{ matrix.os }} | |
needs: publish-to-testpypi | |
strategy: | |
matrix: | |
os: ["windows-2019", "windows-2022"] | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install python-snap7 | |
run: | | |
pip.exe install --upgrade pip | |
pip.exe install --extra-index-url https://test.pypi.org/simple/ python-snap7[test] |