From e1af717c59cd0b718d83db84705612519dfae8ee Mon Sep 17 00:00:00 2001 From: LinasKo Date: Wed, 6 Nov 2024 15:35:49 +0200 Subject: [PATCH] Add environment to publish.yml, publish-test.yml * Similar issue: https://github.com/pypa/gh-action-pypi-publish/issues/217#issuecomment-1965733177 * Minor stylistic edits to the file --- .github/workflows/publish-test.yml | 7 ++++--- .github/workflows/publish.yml | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml index 567a6aba..2cd05bf1 100644 --- a/.github/workflows/publish-test.yml +++ b/.github/workflows/publish-test.yml @@ -2,9 +2,9 @@ name: Publish Supervision Pre-Releases to PyPI and TestPyPI on: push: tags: - - '[0-9]+.[0-9]+[0-9]+.[0-9]+a[0-9]' - - '[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]' - - '[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]' + - "[0-9]+.[0-9]+[0-9]+.[0-9]+a[0-9]" + - "[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]" + - "[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]" workflow_dispatch: @@ -12,6 +12,7 @@ jobs: build-and-publish-pre-release-pypi: name: Build and publish to PyPI runs-on: ubuntu-latest + environment: test permissions: id-token: write strategy: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f9a14d22..17c2629a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,13 +2,14 @@ name: Publish Supervision Releases to PyPI and TestPyPI on: push: tags: - - '[0-9]+.[0-9]+[0-9]+.[0-9]' + - "[0-9]+.[0-9]+[0-9]+.[0-9]" workflow_dispatch: jobs: build-and-publish-pre-release: runs-on: ubuntu-latest + environment: release permissions: id-token: write strategy: @@ -24,7 +25,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: 🏗️ Build source and wheel distributions + - name: 🏗️ Build source and wheel distributions run: | python -m pip install --upgrade build twine python -m build