Skip to content

Commit 184b2db

Browse files
committed
[Copilot] package names should use hyphens in deploy script
1 parent cc1bfef commit 184b2db

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
type: choice
1313
options:
1414
- core
15-
- public_health
15+
- public-health
1616

1717
jobs:
1818
deploy:
@@ -27,16 +27,17 @@ jobs:
2727
# Extract package name from tag by stripping version (core-v1.0.0 -> core, public-health-v1.0.0 -> public-health)
2828
TAG_NAME="${{ github.event.release.tag_name }}"
2929
# Remove -v* suffix to get package name, then convert hyphens to underscores for public_health
30-
PACKAGE_RAW="${TAG_NAME%-v*}"
31-
PACKAGE_NAME="${PACKAGE_RAW//-/_}"
30+
PACKAGE_INPUT="${TAG_NAME%-v*}"
31+
PACKAGE_NAME="${PACKAGE_INPUT//-/_}"
3232
else
3333
# Use input directly for workflow_dispatch
34-
PACKAGE_NAME="${{ github.event.inputs.package }}"
34+
PACKAGE_INPUT="${{ github.event.inputs.package }}"
35+
PACKAGE_NAME="${PACKAGE_INPUT//-/_}" # Convert hyphens to underscores for paths
3536
fi
3637
3738
# Transform package name to path and tag pattern using string manipulation
3839
PACKAGE_PATH="libs/${PACKAGE_NAME}"
39-
TAG_PATTERN="${PACKAGE_NAME//_/-}-v" # public_health -> public-health-v, core -> core-v
40+
TAG_PATTERN="${PACKAGE_INPUT}-v" # public_health -> public-health-v, core -> core-v
4041
4142
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
4243
echo "PACKAGE_PATH=$PACKAGE_PATH" >> $GITHUB_ENV
@@ -54,24 +55,24 @@ jobs:
5455
run: |
5556
curl -LsSf https://astral.sh/uv/install.sh | sh
5657
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
57-
- name: Fetch git tags for ${PACKAGE_NAME}
58+
- name: Fetch git tags for package
5859
run: |
5960
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
60-
echo "Available ${PACKAGE_NAME} tags:"
61+
echo "Available ${PACKAGE_INPUT} tags:"
6162
git tag --list "${TAG_PATTERN}*" | head -10
62-
echo "Current git describe for ${PACKAGE_NAME} tags:"
63-
git describe --tags --match "${TAG_PATTERN}*" || echo "No ${PACKAGE_NAME} tags found"
63+
echo "Current git describe for ${PACKAGE_INPUT} tags:"
64+
git describe --tags --match "${TAG_PATTERN}*" || echo "No ${PACKAGE_INPUT} tags found"
6465
echo "Git log --oneline (last 5):"
6566
git log --oneline -5
6667
- name: Install dependencies
6768
run: |
6869
python --version
6970
uv pip install --system setuptools wheel build
70-
- name: Build ${PACKAGE_NAME}
71+
- name: Build package
7172
run: |
7273
cd ${PACKAGE_PATH}
7374
python -m build
74-
- name: Publish ${PACKAGE_NAME} to PyPI
75+
- name: Publish package to PyPI
7576
uses: pypa/gh-action-pypi-publish@release/v1
7677
with:
7778
packages-dir: ${{ env.PACKAGE_PATH }}/dist/

0 commit comments

Comments
 (0)