-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
name: Release on Github and publish on PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
# After vMajor.Minor.Patch _anything_ is allowed (without "/") ! | ||
- v[0-9]+.[0-9]+.[0-9]+* | ||
|
||
jobs: | ||
release_and_publish: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'nanotech-empa/cp2k-spm-tools' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install MPICH | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y mpich libmpich-dev | ||
- name: Install pypa/build | ||
run: | | ||
python -m pip install build | ||
- name: Build source distribution | ||
run: python -m build . --wheel --sdist | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
dist/* | ||
generate_release_notes: true | ||
|
||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|