From 9d63681349879db2e807f3c1562a0d1267255298 Mon Sep 17 00:00:00 2001 From: Chris Rink Date: Sat, 7 Jun 2025 16:16:14 -0400 Subject: [PATCH 1/6] Publish artifacts to Github Release --- .github/workflows/pypi-release.yml | 33 ++++++++++++++++- .github/workflows/test-pypi-release.yml | 48 +++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-pypi-release.yml diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 016a8c70..4a6988aa 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -9,6 +9,7 @@ concurrency: jobs: build: + name: Build the distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -27,10 +28,40 @@ jobs: path: dist/ if-no-files-found: error - release: + github-release: + runs-on: ubuntu-latest + environment: + name: release + name: >- + Sign the Python distribution with Sigstore and upload them to GitHub Release + needs: + - build + + permissions: + contents: write + id-token: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + path: dist/ + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v3.0.0 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - name: Upload artifact signatures to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: gh release upload "$GITHUB_REF_NAME" dist/** --repo "$GITHUB_REPOSITORY" + + pypi-release: runs-on: ubuntu-latest environment: name: release + name: Release to PyPI needs: - build permissions: diff --git a/.github/workflows/test-pypi-release.yml b/.github/workflows/test-pypi-release.yml new file mode 100644 index 00000000..8ed2448d --- /dev/null +++ b/.github/workflows/test-pypi-release.yml @@ -0,0 +1,48 @@ +name: Release to Test PyPI + +on: + push: + branches: [ main, "feature/publish-artifacts-to-release" ] + +concurrency: + group: test-pypi-release + +jobs: + build: + name: Build the distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ vars.PYTHON_VERSION }} + - name: Install Poetry + run: curl -sSL https://install.python-poetry.org | python3 - + - name: Build Basilisp distributions + run: poetry build + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + path: dist/ + if-no-files-found: error + + test-pypi-release: + runs-on: ubuntu-latest + environment: + name: test-pypi + url: https://test.pypi.org/p/basilisp + name: Release to PyPI + needs: + - build + permissions: + id-token: write + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + path: dist/ + merge-multiple: true + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@v1.12.2 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file From 4f29c50defc2033f2a7991af4df93bcab7a0ed5b Mon Sep 17 00:00:00 2001 From: Chris Rink Date: Sat, 7 Jun 2025 16:25:32 -0400 Subject: [PATCH 2/6] Why --- .github/workflows/pypi-release.yml | 2 +- .github/workflows/test-pypi-release.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 4a6988aa..163234e3 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -73,4 +73,4 @@ jobs: path: dist/ merge-multiple: true - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.2 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@v1 \ No newline at end of file diff --git a/.github/workflows/test-pypi-release.yml b/.github/workflows/test-pypi-release.yml index 8ed2448d..f259b813 100644 --- a/.github/workflows/test-pypi-release.yml +++ b/.github/workflows/test-pypi-release.yml @@ -31,7 +31,7 @@ jobs: environment: name: test-pypi url: https://test.pypi.org/p/basilisp - name: Release to PyPI + name: Release to Test PyPI needs: - build permissions: @@ -43,6 +43,6 @@ jobs: path: dist/ merge-multiple: true - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.2 + uses: pypa/gh-action-pypi-publish@v1 with: repository-url: https://test.pypi.org/legacy/ \ No newline at end of file From 14f5ec923d6faf4040b90ab01581aabe32d371d4 Mon Sep 17 00:00:00 2001 From: Chris Rink Date: Sat, 7 Jun 2025 16:26:55 -0400 Subject: [PATCH 3/6] EMpty From 9ed6df842e357ff13e0e69c289d7964603256f04 Mon Sep 17 00:00:00 2001 From: Chris Rink Date: Sat, 7 Jun 2025 16:28:32 -0400 Subject: [PATCH 4/6] 1.12.4 --- .github/workflows/pypi-release.yml | 2 +- .github/workflows/test-pypi-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 163234e3..4947bfcf 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -73,4 +73,4 @@ jobs: path: dist/ merge-multiple: true - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@v1.12.4 \ No newline at end of file diff --git a/.github/workflows/test-pypi-release.yml b/.github/workflows/test-pypi-release.yml index f259b813..28cbe915 100644 --- a/.github/workflows/test-pypi-release.yml +++ b/.github/workflows/test-pypi-release.yml @@ -43,6 +43,6 @@ jobs: path: dist/ merge-multiple: true - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@v1 + uses: pypa/gh-action-pypi-publish@v1.12.4 with: repository-url: https://test.pypi.org/legacy/ \ No newline at end of file From 5c072a1406041a40630a45085fefba5312733e8b Mon Sep 17 00:00:00 2001 From: Chris Rink Date: Sat, 7 Jun 2025 16:32:49 -0400 Subject: [PATCH 5/6] Skip existing --- .github/workflows/test-pypi-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pypi-release.yml b/.github/workflows/test-pypi-release.yml index 28cbe915..ab468b5b 100644 --- a/.github/workflows/test-pypi-release.yml +++ b/.github/workflows/test-pypi-release.yml @@ -45,4 +45,5 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@v1.12.4 with: - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ + skip-existing: true \ No newline at end of file From 09cd0231b6b88548dac34051445e5aec9c37211d Mon Sep 17 00:00:00 2001 From: Chris Rink Date: Sat, 7 Jun 2025 16:34:02 -0400 Subject: [PATCH 6/6] Remove branch ref --- .github/workflows/test-pypi-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pypi-release.yml b/.github/workflows/test-pypi-release.yml index ab468b5b..973cf22d 100644 --- a/.github/workflows/test-pypi-release.yml +++ b/.github/workflows/test-pypi-release.yml @@ -2,7 +2,7 @@ name: Release to Test PyPI on: push: - branches: [ main, "feature/publish-artifacts-to-release" ] + branches: [ main ] concurrency: group: test-pypi-release