From 1628e4caa8fa4dac59d85240862bba0f22c192cc Mon Sep 17 00:00:00 2001 From: Dave Hall Date: Mon, 15 Jan 2024 20:15:01 +0000 Subject: [PATCH] Added `deploy` workflow (#3) - Tightened permissions for existing `build` workflow. - Created new `deploy` workflow that triggers on release publish. --- .github/workflows/build.yml | 3 +++ .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ pyproject.toml | 4 ++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3c2cf72..67142335 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,9 @@ name: Build on: push +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..1bb4de83 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Deploy + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + environment: PyPI + steps: + - uses: actions/checkout@v4 + # Install toolchain. + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - run: pipx install poetry + # Build. + - run: poetry build + # Release. + - run: poetry config pypi-token.pypi "${{ secrets.PYPI_TOKEN }}" + - run: poetry publish diff --git a/pyproject.toml b/pyproject.toml index ba135096..70bb8870 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "logtest" -version = "0.1.0" +version = "0.0.1-a0" description = "Log-based testing" authors = ["Dave Hall "] license = "MIT" @@ -13,7 +13,7 @@ packages = [{ include = "logtest" }] [tool.poetry.dependencies] python = "^3.8" -pytest = {version = "^7.4.4", optional = true} +pytest = { version = "^7.4.4", optional = true } [tool.poetry.extras] pytest = ["pytest"]