Skip to content

Commit 872bc27

Browse files
committed
Github action: release & publish
1 parent 651a80b commit 872bc27

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Release on Github and publish on PyPI
3+
4+
on:
5+
push:
6+
tags:
7+
# After vMajor.Minor.Patch _anything_ is allowed (without "/") !
8+
- v[0-9]+.[0-9]+.[0-9]+*
9+
10+
jobs:
11+
release_and_publish:
12+
runs-on: ubuntu-latest
13+
if: github.repository == 'osscar-org/widget-periodictable' && startsWith(github.ref, 'refs/tags/v')
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Python 3.10
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.10"
23+
24+
- name: Install pypa/build
25+
run: |
26+
python -m pip install build
27+
28+
- name: Build source distribution
29+
run: python -m build . --wheel --sdist
30+
31+
- name: Create release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
files: |
35+
dist/*
36+
generate_release_notes: true
37+
38+
- name: Publish package to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
user: __token__
42+
password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)