diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index e69b9c86..61e994e9 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -2,16 +2,16 @@ name: PyPI on: push: - branches: - - 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: @@ -28,9 +28,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 @@ -43,7 +43,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 @@ -64,27 +63,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/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 0164c367..c05922d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,9 @@ add_subdirectory(share) # executable add_subdirectory(bin) # Executables +# packaging versions +add_subdirectory(packaging) + # ############# # Debian Package diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt new file mode 100644 index 00000000..08fd881f --- /dev/null +++ b/packaging/CMakeLists.txt @@ -0,0 +1,7 @@ +# Configure the version of packaging files +configure_file(conda/meta.yaml.in conda/meta.yaml) +configure_file(pypi/MANIFEST.in pypi/MANIFEST.in COPYONLY) +configure_file(pypi/pyproject.toml.in pypi/pyproject.toml) +configure_file(solid_dmft-foss-2021b.eb.in solid_dmft-foss-2021b.eb) + + diff --git a/packaging/conda/meta.yaml b/packaging/conda/meta.yaml.in similarity index 96% rename from packaging/conda/meta.yaml rename to packaging/conda/meta.yaml.in index 64e04fb4..ec7f1be8 100644 --- a/packaging/conda/meta.yaml +++ b/packaging/conda/meta.yaml.in @@ -1,4 +1,4 @@ -{% set version = "3.2.1" %} +{% set version = "@PROJECT_VERSION@" %} package: name: solid_dmft diff --git a/packaging/pypi/pyproject.toml b/packaging/pypi/pyproject.toml.in similarity index 96% rename from packaging/pypi/pyproject.toml rename to packaging/pypi/pyproject.toml.in index 63ace4a6..ec88af59 100644 --- a/packaging/pypi/pyproject.toml +++ b/packaging/pypi/pyproject.toml.in @@ -7,7 +7,7 @@ where = ["python"] [project] name = "solid_dmft" -version = "3.2.1" +version = "@PROJECT_VERSION@" authors = [ { name="Alexander Hampel", email="ahampel@flatironinstitute.org" } ] diff --git a/packaging/solid_dmft-3.2.0-foss-2021b.eb b/packaging/solid_dmft-foss-2021b.eb.in similarity index 97% rename from packaging/solid_dmft-3.2.0-foss-2021b.eb rename to packaging/solid_dmft-foss-2021b.eb.in index 5c231293..8cff2166 100644 --- a/packaging/solid_dmft-3.2.0-foss-2021b.eb +++ b/packaging/solid_dmft-foss-2021b.eb.in @@ -1,7 +1,7 @@ easyblock = 'CMakeMake' name = 'solid_dmft' -version = '3.2.1' +version = '@PROJECT_VERSION@' homepage = 'https://triqs.github.io/solid_dmft/' description = """