From ec5ecdbc8bd68f946581a6ac7e135b0b537e4f7a Mon Sep 17 00:00:00 2001 From: Paul Topley Date: Fri, 21 Mar 2025 10:42:35 +0000 Subject: [PATCH 1/2] Release Pipeline. --- .github/workflows/release.yaml | 32 ++++++++++++++++++++++++++++++++ .gitignore | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..2c5fe95 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,32 @@ +name: Release +on: + release: + types: [created] + +jobs: + pypi-publish: + name: Publish release to PyPI + runs-on: ubuntu-latest + environment: + name: test-pypi + url: https://test.pypi.org/p/pepper-test + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build package + run: | + python setup.py sdist bdist_wheel # Could also be python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ diff --git a/.gitignore b/.gitignore index be26a46..839607d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ dist/ salt_pepper.egg-info/ .nox/ artifacts/ +.egg-info/ +.eggs/ \ No newline at end of file From 085ceea8ffd4ca6b5991acce321c4e086a0f90c1 Mon Sep 17 00:00:00 2001 From: Paul Topley Date: Fri, 21 Mar 2025 10:45:56 +0000 Subject: [PATCH 2/2] Change for production pypi. --- .github/workflows/release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2c5fe95..e77c683 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,8 +8,8 @@ jobs: name: Publish release to PyPI runs-on: ubuntu-latest environment: - name: test-pypi - url: https://test.pypi.org/p/pepper-test + name: pypi + url: https://pypi.org/p/salt-pepper permissions: id-token: write steps: @@ -28,5 +28,5 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_API_TOKEN }} + repository-url: https://pypi.org/legacy/