Skip to content

Commit

Permalink
gh-176: revamp publishing workflow (#209)
Browse files Browse the repository at this point in the history
The developers will now be able to download wheels as artifacts from GH
Actions without actually publishing a release. This helps in checking if
everything is working well or if you want to distribute a pre-release
wheel. Anyways, it is a good practice to keep these 2 jobs separate.

Closes: #176
Refs: #187
  • Loading branch information
Saransh-cpp committed Sep 18, 2024
1 parent 7c1d9d2 commit 465f72a
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
name: Release

on:
workflow_dispatch:
release:
types:
- published

jobs:
dist:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4

- name: Build SDist and wheel
run: pipx run build

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v4
with:
path: dist/*

publish:
name: Publish on PyPI
needs: [dist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: publish
url: https://pypi.org/p/glass
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
- run: pipx run build
- uses: pypa/[email protected]
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: List distributions to be deployed
run: ls -l dist/

- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 465f72a

Please sign in to comment.