From 6d2ba73e68e72d496023d24f484962b02f4abc9b Mon Sep 17 00:00:00 2001 From: ACornuIGN Date: Fri, 4 Oct 2024 09:45:23 +0200 Subject: [PATCH 1/2] build: add workflows publisher test on test pypi --- .github/workflows/publish_pypi.yml | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/publish_pypi.yml diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml new file mode 100644 index 0000000..33710e9 --- /dev/null +++ b/.github/workflows/publish_pypi.yml @@ -0,0 +1,55 @@ +name: Publish ign-borea package on PyPI + +on: + push: + branches: [deploy_pypi] + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install pypa/build + run: python3 -m pip install build + + - name: Build a binary wheel and a source tarball + run: python3 -m build + + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + + publish-to-testpypi: + name: Publish Python distribution to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/ign-borea + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + - name: Publish distribution to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From 0116c641d202a6667c22e06394f73925fcc5220c Mon Sep 17 00:00:00 2001 From: ACornuIGN Date: Fri, 4 Oct 2024 10:51:32 +0200 Subject: [PATCH 2/2] feat: change workflows to publish in pypi --- .github/workflows/publish_pypi.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 33710e9..260ae33 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -1,8 +1,8 @@ name: Publish ign-borea package on PyPI on: - push: - branches: [deploy_pypi] + release: + types: [released] jobs: build: @@ -29,18 +29,18 @@ jobs: path: dist/ - publish-to-testpypi: - name: Publish Python distribution to TestPyPI + publish-to-pypi: + name: Publish Python distribution to PyPI needs: - build runs-on: ubuntu-latest environment: - name: testpypi - url: https://test.pypi.org/p/ign-borea + name: pypi + url: https://pypi.org/p/ign-borea permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing + id-token: write steps: - name: Download all the dists @@ -51,5 +51,3 @@ jobs: - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/