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 c952b14
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 30 deletions.
31 changes: 4 additions & 27 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
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:
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
7 changes: 7 additions & 0 deletions packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)


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 c952b14

Please sign in to comment.