Skip to content

Commit c6633ad

Browse files
authored
Merge pull request #40 from DataFog/dev-local
publish-pypi.yml
2 parents 4389855 + b4266d9 commit c6633ad

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PyPI Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to release (e.g., 1.2.3)"
8+
required: true
9+
confirm_tests:
10+
description: "Confirm all tests have passed"
11+
type: boolean
12+
required: true
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
if: github.event.inputs.confirm_tests == 'true'
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.10"
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
- name: Build package
29+
run: python -m build
30+
- name: Create GitHub Release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
git config user.name github-actions
35+
git config user.email github-actions@github.com
36+
git tag v${{ github.event.inputs.version }}
37+
git push origin v${{ github.event.inputs.version }}
38+
gh release create v${{ github.event.inputs.version }} --generate-notes
39+
- name: Publish to PyPI
40+
env:
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
43+
run: twine upload dist/*

0 commit comments

Comments
 (0)