From 7a4bee85e5e4abe714fc4cf9c66f6979aabdd5e5 Mon Sep 17 00:00:00 2001 From: nikteliy Date: Mon, 23 Feb 2026 13:24:24 +0600 Subject: [PATCH] Add publish workflow --- .github/workflows/publish.yml | 62 +++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f243d38 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,62 @@ +name: Publish + +on: + push: + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 + - run: uv build + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + testpypi: + needs: build + runs-on: ubuntu-latest + environment: testpypi + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + pypi: + needs: testpypi + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + - name: Create GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: gh release create ${{ github.ref_name }} dist/* --generate-notes diff --git a/pyproject.toml b/pyproject.toml index 99b7c4d..cd95e4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-s7comm" -version = "0.0.1" +version = "0.1.0" description = "Unofficial Python implementation of Siemens S7 communication protocol" readme = "README.md" requires-python = ">=3.12"