From ec1153d8d5d1fd51a2cfdfaa09ec186aac4941e2 Mon Sep 17 00:00:00 2001 From: Wesley van Lee Date: Mon, 21 Oct 2024 10:17:27 +0200 Subject: [PATCH 1/3] Add release workflow backbone --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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..2278dec --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + release: + types: + - created + +jobs: + publish: + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install build dependencies + run: pip install build + - name: Build distribution + run: python -m build + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.10.3 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" From 433a314caf278331cc43ea08514160daa2bb52eb Mon Sep 17 00:00:00 2001 From: Wesley van Lee Date: Mon, 21 Oct 2024 10:50:56 +0200 Subject: [PATCH 2/3] Add some whitespace in the release workflow and remove the GitHub context dump steps --- .github/workflows/release.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2278dec..d9b28d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,22 +12,17 @@ jobs: permissions: id-token: write steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.8" + - name: Install build dependencies run: pip install build + - name: Build distribution run: python -m build + - name: Publish uses: pypa/gh-action-pypi-publish@v1.10.3 - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" From 4c53092532895df8dd465c4b058c19a17509bc36 Mon Sep 17 00:00:00 2001 From: Wesley van Lee Date: Mon, 21 Oct 2024 13:17:00 +0200 Subject: [PATCH 3/3] Add workflow for release test PyPI and add some more blank spacing --- .github/workflows/release-test.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/release-test.yml diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 0000000..966dcf5 --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,30 @@ +name: Release to test PyPI + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + environment: release + + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Install build dependencies + run: pip install build + + - name: Build distribution + run: python -m build + + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.10.3 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9b28d7..8cb755e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,10 @@ jobs: publish: runs-on: ubuntu-latest environment: release + permissions: id-token: write + steps: - uses: actions/checkout@v4 - name: Set up Python