Skip to content

Commit

Permalink
Merge pull request #21 from jaqx0r/release
Browse files Browse the repository at this point in the history
ci: Add a release workflow config.
  • Loading branch information
jaqx0r committed Sep 10, 2023
2 parents ba7dc36 + 44fa60c commit 79ec936
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: release
on:
# Always test on pull_request, but do not do release (see check for tag below)
pull_request:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-python@v4
- run: sudo apt-get install -y libmad0-dev
- run: python -m pip install --upgrade pip
- run: python -m pip install build
- run: python -m build --sdist --wheel --outdir dist/
- uses: actions/upload-artifact@v1
with:
name: dist
path: dist


release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: softprops/action-gh-release@v1
# Only on a tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
generate_release_notes: true
files: |
dist/*.tar.gz
dist/*.whl
publish:
needs: [build, release]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
# Only on a tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

0 comments on commit 79ec936

Please sign in to comment.