From 3cd34604afd596841a50079071cca23820de4279 Mon Sep 17 00:00:00 2001 From: "Douglas Cerna (Soy Douglas)" Date: Wed, 8 Nov 2023 19:09:55 +0100 Subject: [PATCH] Add GitHub workflow for uploading to PyPI --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d2c8ed7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +--- +name: "Release" +on: "workflow_dispatch" +jobs: + build: + name: "Build" + runs-on: "ubuntu-22.04" + steps: + - name: "Check out repository" + uses: "actions/checkout@v4" + - name: "Set up Python" + uses: "actions/setup-python@v4" + with: + python-version: "3.9" + - name: "Build distribution packages" + run: make package-check + - name: "Save distribution directory" + uses: "actions/upload-artifact@v3" + with: + name: "distribution" + path: | + dist + upload: + name: "Upload" + needs: "build" + runs-on: "ubuntu-22.04" + environment: "release" + permissions: + id-token: "write" + steps: + - name: "Restore distribution directory" + uses: "actions/download-artifact@v3" + with: + name: "distribution" + path: | + dist + - name: "Upload distribution packages to PyPI" + uses: "pypa/gh-action-pypi-publish@release/v1" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78fd697..593ef90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: branches: - "master" jobs: - tox: + test: name: "Test Python ${{ matrix.python-version }}" runs-on: "ubuntu-22.04" strategy: