Skip to content

Commit

Permalink
Add release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Nov 12, 2024
1 parent d0d9921 commit fe63939
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
workflow_dispatch:
push:
# Pattern matched against refs/tags
tags:
- '*'

jobs:
source_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
- name: Install build
run: python -m pip install build
- name: Make distribution
run: python -m build --sdist --wheel
- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*
- uses: softprops/action-gh-release@v1
name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade twine
python -m twine upload dist/*
env:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit fe63939

Please sign in to comment.