Skip to content

Commit 8d2fc65

Browse files
committed
refactor: derive PyPI package name from .project.yml config
- Add pypi-name output to get-config action - Read pypi_name from .project.yml (orb-py) - Update dev-pypi.yml to use dynamic pypi-name in URLs and summaries - Remove hardcoded 'orb-py' references from workflows - Single source of truth for package naming
1 parent 6fc542f commit 8d2fc65

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/actions/get-config/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ outputs:
1919
is-release:
2020
description: 'Whether this is a release build'
2121
value: ${{ steps.config.outputs.is-release }}
22+
pypi-name:
23+
description: 'PyPI package name'
24+
value: ${{ steps.config.outputs.pypi-name }}
2225
runs:
2326
using: 'composite'
2427
steps:
@@ -35,6 +38,7 @@ runs:
3538
REPO_ORG=$(yq '.repository.org' .project.yml)
3639
REPO_NAME=$(yq '.repository.name' .project.yml)
3740
CONTAINER_IMAGE="$REPO_ORG/$REPO_NAME"
41+
PYPI_NAME=$(yq '.project.pypi_name' .project.yml)
3842
3943
# Centralized version generation using Makefile infrastructure
4044
if [[ "${{ github.event_name }}" == "release" ]]; then
@@ -54,6 +58,7 @@ runs:
5458
echo "container-image=$CONTAINER_IMAGE"
5559
echo "package-version=$PACKAGE_VERSION"
5660
echo "is-release=$IS_RELEASE"
61+
echo "pypi-name=$PYPI_NAME"
5762
} >> "$GITHUB_OUTPUT"
5863
5964
echo "Default Python version: $DEFAULT_PYTHON_VERSION"
@@ -62,3 +67,4 @@ runs:
6267
echo "Container image: $CONTAINER_IMAGE"
6368
echo "Package version: $PACKAGE_VERSION"
6469
echo "Is release: $IS_RELEASE"
70+
echo "PyPI name: $PYPI_NAME"

.github/workflows/dev-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
outputs:
4747
default-python-version: ${{ steps.config.outputs.default-python-version }}
4848
package-version: ${{ steps.config.outputs.package-version }}
49-
is-release: ${{ steps.config.outputs.is-release }}
49+
pypi-name: ${{ steps.config.outputs.pypi-name }}
5050
steps:
5151
- name: Checkout code
5252
uses: actions/checkout@v6.0.1
@@ -61,7 +61,7 @@ jobs:
6161
needs: [get-config]
6262
environment:
6363
name: testpypi
64-
url: https://test.pypi.org/p/orb-py
64+
url: https://test.pypi.org/p/${{ needs.get-config.outputs.pypi-name }}
6565
permissions:
6666
id-token: write # IMPORTANT: mandatory for trusted publishing
6767
contents: read # needed to checkout code
@@ -106,7 +106,7 @@ jobs:
106106
echo "## Package Published Successfully"
107107
echo ""
108108
echo "**Environment:** Test PyPI"
109-
echo "**Installation:** \`pip install --index-url https://test.pypi.org/simple/ orb-py\`"
109+
echo "**Installation:** \`pip install --index-url https://test.pypi.org/simple/ ${{ needs.get-config.outputs.pypi-name }}\`"
110110
echo ""
111111
echo "**Version:** $VERSION"
112112
echo "**Commands:**"

.github/workflows/prod-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
container-image: ${{ steps.config.outputs.container-image }}
3232
package-version: ${{ steps.config.outputs.package-version }}
3333
is-release: ${{ steps.config.outputs.is-release }}
34+
pypi-name: ${{ steps.config.outputs.pypi-name }}
3435
steps:
3536
- name: Checkout code
3637
uses: actions/checkout@v6.0.1

0 commit comments

Comments
 (0)