Skip to content

Commit d96a871

Browse files
authored
Merge pull request #30 from blowekamp/add_publish
Add GHA publish to publish release to github
2 parents d5a871c + bfaa98a commit d96a871

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
concurrency:
9+
group: publish
10+
11+
12+
jobs:
13+
publish:
14+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
15+
name: Upload release to Github Releases and PyPI
16+
runs-on: ubuntu-latest
17+
permissions:
18+
id-token: write
19+
contents: write
20+
environment: publish
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Python 3.11
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.11"
29+
- name: Build package
30+
run: |
31+
python -m pip install twine build
32+
python -m build --wheel --sdist
33+
python -m twine check dist/*
34+
ls -la dist
35+
- name: Create Release and Upload
36+
id: create_release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: |
40+
gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --verify-tag --generate-notes --title "Release ${{ github.ref_name }}"
41+
gh release upload ${{ github.ref_name }} --repo ${{ github.repository }} dist/*

0 commit comments

Comments
 (0)