Skip to content

Commit

Permalink
gh-176: revamp publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Sep 18, 2024
1 parent a101ab4 commit 848e4a1
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,49 @@
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
with:
fetch-depth: 0

- 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 848e4a1

Please sign in to comment.