Skip to content

Commit 7ff18ad

Browse files
DO-1298 upload-proget
1 parent f743d32 commit 7ff18ad

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

.github/workflows/build-base-python.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: Checkout
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3333

3434
- name: Set output
3535
id: set_output
@@ -61,7 +61,7 @@ jobs:
6161

6262
steps:
6363
- name: Checkout
64-
uses: actions/checkout@v4
64+
uses: actions/checkout@v5
6565

6666
- name: Set up Python
6767
uses: actions/setup-python@v5
@@ -102,3 +102,36 @@ jobs:
102102
jfrog rt upload --flat \
103103
"${{ env.archive_path }}/${{ env.archive_filename }}" \
104104
"ccdc-3rdparty-python-interpreters/base_python/${{ env.shortversion }}/"
105+
106+
- name: upload base python to ProGet
107+
if: ${{ inputs.deploy == 'upload' }}
108+
shell: bash
109+
env:
110+
PROGET_API_KEY: ${{ secrets.PROGET_API_KEY }}
111+
PROGET_BASE_URL: ${{ vars.PROGET_BASE_URL || 'https://proget.ccdc.cam.ac.uk' }}
112+
PROGET_ASSET_DIRECTORY: ${{ vars.PROGET_ASSET_DIRECTORY || 'ccdc-3rdparty-python-interpreters' }}
113+
run: |
114+
# Upload the base python to ProGet using HTTP API
115+
echo "Uploading ${{ env.archive_filename }} to ProGet..."
116+
117+
# Construct the ProGet API endpoint
118+
PROGET_ENDPOINT="${PROGET_BASE_URL}/endpoints/${PROGET_ASSET_DIRECTORY}/content/base_python/${{ env.shortversion }}/${{ env.archive_filename }}"
119+
120+
echo "ProGet endpoint: $PROGET_ENDPOINT"
121+
122+
# Upload using curl with POST method (creates or overwrites existing file)
123+
curl -X POST \
124+
-H "Content-Type: application/octet-stream" \
125+
-H "X-ApiKey: ${PROGET_API_KEY}" \
126+
--data-binary "@${{ env.archive_path }}/${{ env.archive_filename }}" \
127+
--fail-with-body \
128+
"$PROGET_ENDPOINT"
129+
130+
if [ $? -eq 0 ]; then
131+
echo "Successfully uploaded ${{ env.archive_filename }} to ProGet"
132+
else
133+
echo "Failed to upload ${{ env.archive_filename }} to ProGet"
134+
exit 1
135+
fi
136+
137+

0 commit comments

Comments
 (0)