From 0d00a13830b6a3669b0fc0adb229534d3485f91e Mon Sep 17 00:00:00 2001 From: Emily Carpenter Date: Thu, 27 Aug 2026 16:47:54 -0600 Subject: [PATCH 1/4] add pypi publishing --- .github/scripts/install-conda.sh | 2 +- .github/scripts/pypi-package-build.sh | 7 +++++++ .github/workflows/release.yaml | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 .github/scripts/pypi-package-build.sh diff --git a/.github/scripts/install-conda.sh b/.github/scripts/install-conda.sh index b9ba30249..d2a6e86e1 100755 --- a/.github/scripts/install-conda.sh +++ b/.github/scripts/install-conda.sh @@ -6,4 +6,4 @@ wget --no-verbose -O $installer $url bash $installer -bfp $CI_CONDA_DIR set +ux ci_conda_activate -conda install --quiet --yes --channel maddenp --repodata-fn repodata.json anaconda-client condev jq +conda install --quiet --yes --channel maddenp --repodata-fn repodata.json anaconda-client condev jq python-build diff --git a/.github/scripts/pypi-package-build.sh b/.github/scripts/pypi-package-build.sh new file mode 100755 index 000000000..458fb2905 --- /dev/null +++ b/.github/scripts/pypi-package-build.sh @@ -0,0 +1,7 @@ +#!/bin/bash -eux + +. $(dirname ${BASH_SOURCE[0]})/common.sh +ci_conda_activate +unset CONDEV_SHELL +set -ux +python -m build --no-isolation --wheel src diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 775e6a02e..010110072 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,13 @@ jobs: run: .github/scripts/make-docs.sh - name: Format Check run: .github/scripts/format-check.sh + - name: Make PyPI Package + run: .github/scripts/pypi-package-build.sh - name: Make Package run: .github/scripts/make-package.sh - name: Publish run: .github/scripts/publish.sh + - name: Publish PyPI Package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: src/dist/ From e4373a25ae7e958bec0189f58c7a7653db2d83c3 Mon Sep 17 00:00:00 2001 From: Emily Carpenter Date: Thu, 27 Aug 2026 16:53:35 -0600 Subject: [PATCH 2/4] add permissions --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 010110072..3de46e6b5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,6 +9,8 @@ jobs: release: name: Release runs-on: ubuntu-latest + permissions: + id-token: write steps: - uses: actions/checkout@v3 - name: Install conda From dcbc20ba4074a9301a8fd061d81cec52a1a50d63 Mon Sep 17 00:00:00 2001 From: Emily Carpenter Date: Thu, 27 Aug 2026 17:30:53 -0600 Subject: [PATCH 3/4] paul's suggestion --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3de46e6b5..005b86bf0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,12 +19,12 @@ jobs: run: .github/scripts/make-docs.sh - name: Format Check run: .github/scripts/format-check.sh - - name: Make PyPI Package - run: .github/scripts/pypi-package-build.sh - name: Make Package run: .github/scripts/make-package.sh - name: Publish run: .github/scripts/publish.sh + - name: Make PyPI Package + run: .github/scripts/pypi-package-build.sh - name: Publish PyPI Package uses: pypa/gh-action-pypi-publish@release/v1 with: From a9d8a3d468c3cf9e9ca7c916bc163f58f5dc45da Mon Sep 17 00:00:00 2001 From: Emily Carpenter Date: Tue, 8 Sep 2026 10:33:47 -0600 Subject: [PATCH 4/4] uwtools -> unified-workflow-tools --- .github/scripts/pypi-package-build.sh | 1 + src/setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/pypi-package-build.sh b/.github/scripts/pypi-package-build.sh index 458fb2905..3a36315e7 100755 --- a/.github/scripts/pypi-package-build.sh +++ b/.github/scripts/pypi-package-build.sh @@ -3,5 +3,6 @@ . $(dirname ${BASH_SOURCE[0]})/common.sh ci_conda_activate unset CONDEV_SHELL +export PYPI_PROJECT_NAME=unified-workflow-tools set -ux python -m build --no-isolation --wheel src diff --git a/src/setup.py b/src/setup.py index 43e95b516..702d8d7a8 100644 --- a/src/setup.py +++ b/src/setup.py @@ -24,6 +24,7 @@ metasrc = recipe / "meta.json" meta = json.loads(metasrc.read_text()) name_conda = meta["name"] +name_dist = os.environ.get("PYPI_PROJECT_NAME", name_conda) name_py = name_conda.replace("-", "_") # Define basic setup configuration. @@ -31,7 +32,7 @@ kwargs = { "entry_points": {"console_scripts": ["uw = %s.cli:main" % name_py]}, "include_package_data": True, - "name": name_conda, + "name": name_dist, "packages": find_packages(exclude=["%s.tests" % name_py], include=[name_py, "%s.*" % name_py]), "version": meta["version"], }