Skip to content

Commit 6f6a818

Browse files
Create publish.yml
1 parent d537abd commit 6f6a818

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Publish package
5+
6+
on:
7+
push:
8+
tags:
9+
- '[0-9]+.[0-9]+.[0-9a-zA-Z]+' # Matches 1.2.3, 1.2.3alpha1 etc.
10+
11+
jobs:
12+
publish-pypi:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -r .github/workflows/requirements.txt
24+
- name: Build and publish
25+
env:
26+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28+
run: |
29+
python setup.py sdist bdist_wheel
30+
twine upload --non-interactive dist/*
31+
publish-github-release:
32+
needs: publish-pypi
33+
name: Create Release
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Create Release
38+
uses: softprops/action-gh-release@v1
39+
with:
40+
name: Release ${{ github.ref_name }}
41+
draft: false
42+
prerelease: false

0 commit comments

Comments
 (0)