Skip to content

Commit

Permalink
[build] trigger pypi build on tags only remove testpypi
Browse files Browse the repository at this point in the history
  • Loading branch information
the-hampel committed Sep 26, 2023
1 parent 5e87b75 commit b3c2e1f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 31 deletions.
33 changes: 5 additions & 28 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ name: PyPI

on:
push:
branches:
branch :
- 3.2.x
tags:
- 3.2.*
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
container: # we have to provide a working triqs installation to make the cmake step work
# image: materialstheory/solid_dmft_ci:${{github.ref_name}}
image: materialstheory/solid_dmft_ci:3.2.x

steps:
Expand All @@ -28,9 +30,9 @@ jobs:
--user
- name: prepare python distribution
run: |
cp packaging/pypi/* ./
mkdir build && cd build
cmake ../
cp packaging/pypi/* ../
mv python/solid_dmft/version.py ../python/solid_dmft/version.py
rm ../python/solid_dmft/version.py.in
- name: Build a binary wheel and a source tarball
Expand All @@ -43,7 +45,6 @@ jobs:

publish-to-pypi:
name: Publish PyPI 🐍
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
Expand All @@ -64,27 +65,3 @@ jobs:
with:
skip-existing: true # skip if version name package already exists on pypi

publish-to-testpypi:
name: Publish TestPyPI 🐍
needs:
- build
runs-on: ubuntu-latest

environment:
name: pypi
url: https://test.pypi.org/p/solid_dmft

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true # skip if version name package already exists on pypi
repository-url: https://test.pypi.org/legacy/
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ add_subdirectory(share)
# executable
add_subdirectory(bin) # Executables

# packaging versions
add_subdirectory(packaging)

# #############
# Debian Package

Expand Down
2 changes: 1 addition & 1 deletion packaging/conda/meta.yaml → packaging/conda/meta.yaml.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "3.2.1" %}
{% set version = "@PROJECT_VERSION@" %}

package:
name: solid_dmft
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ where = ["python"]

[project]
name = "solid_dmft"
version = "3.2.1"
version = "@PROJECT_VERSION@"
authors = [
{ name="Alexander Hampel", email="[email protected]" }
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
easyblock = 'CMakeMake'

name = 'solid_dmft'
version = '3.2.1'
version = '@PROJECT_VERSION@'

homepage = 'https://triqs.github.io/solid_dmft/'
description = """
Expand Down

0 comments on commit b3c2e1f

Please sign in to comment.