From 7ff18ad4c850b25dab3daa7e9ccea019f7b0699b Mon Sep 17 00:00:00 2001 From: Manish Maharjan Date: Fri, 26 Sep 2025 15:29:49 +0100 Subject: [PATCH 1/3] DO-1298 upload-proget --- .github/workflows/build-base-python.yml | 37 +++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-base-python.yml b/.github/workflows/build-base-python.yml index f3c3a7e..d7cfdf8 100644 --- a/.github/workflows/build-base-python.yml +++ b/.github/workflows/build-base-python.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set output id: set_output @@ -61,7 +61,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v5 @@ -102,3 +102,36 @@ jobs: jfrog rt upload --flat \ "${{ env.archive_path }}/${{ env.archive_filename }}" \ "ccdc-3rdparty-python-interpreters/base_python/${{ env.shortversion }}/" + + - name: upload base python to ProGet + if: ${{ inputs.deploy == 'upload' }} + shell: bash + env: + PROGET_API_KEY: ${{ secrets.PROGET_API_KEY }} + PROGET_BASE_URL: ${{ vars.PROGET_BASE_URL || 'https://proget.ccdc.cam.ac.uk' }} + PROGET_ASSET_DIRECTORY: ${{ vars.PROGET_ASSET_DIRECTORY || 'ccdc-3rdparty-python-interpreters' }} + run: | + # Upload the base python to ProGet using HTTP API + echo "Uploading ${{ env.archive_filename }} to ProGet..." + + # Construct the ProGet API endpoint + PROGET_ENDPOINT="${PROGET_BASE_URL}/endpoints/${PROGET_ASSET_DIRECTORY}/content/base_python/${{ env.shortversion }}/${{ env.archive_filename }}" + + echo "ProGet endpoint: $PROGET_ENDPOINT" + + # Upload using curl with POST method (creates or overwrites existing file) + curl -X POST \ + -H "Content-Type: application/octet-stream" \ + -H "X-ApiKey: ${PROGET_API_KEY}" \ + --data-binary "@${{ env.archive_path }}/${{ env.archive_filename }}" \ + --fail-with-body \ + "$PROGET_ENDPOINT" + + if [ $? -eq 0 ]; then + echo "Successfully uploaded ${{ env.archive_filename }} to ProGet" + else + echo "Failed to upload ${{ env.archive_filename }} to ProGet" + exit 1 + fi + + From de3a9ff90e6ac5f17aeeb5470e725a01175526d8 Mon Sep 17 00:00:00 2001 From: Manish Maharjan Date: Fri, 26 Sep 2025 15:36:58 +0100 Subject: [PATCH 2/3] DO-1298 updates --- .github/workflows/build-base-python.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-base-python.yml b/.github/workflows/build-base-python.yml index d7cfdf8..b8f66c8 100644 --- a/.github/workflows/build-base-python.yml +++ b/.github/workflows/build-base-python.yml @@ -108,30 +108,21 @@ jobs: shell: bash env: PROGET_API_KEY: ${{ secrets.PROGET_API_KEY }} - PROGET_BASE_URL: ${{ vars.PROGET_BASE_URL || 'https://proget.ccdc.cam.ac.uk' }} - PROGET_ASSET_DIRECTORY: ${{ vars.PROGET_ASSET_DIRECTORY || 'ccdc-3rdparty-python-interpreters' }} + PROGET_BASE_URL: ${{ vars.PROGET_BASE_URL }} + PROGET_ASSET_DIRECTORY: ${{ vars.PROGET_ASSET_DIRECTORY }} run: | - # Upload the base python to ProGet using HTTP API - echo "Uploading ${{ env.archive_filename }} to ProGet..." - - # Construct the ProGet API endpoint PROGET_ENDPOINT="${PROGET_BASE_URL}/endpoints/${PROGET_ASSET_DIRECTORY}/content/base_python/${{ env.shortversion }}/${{ env.archive_filename }}" - echo "ProGet endpoint: $PROGET_ENDPOINT" - - # Upload using curl with POST method (creates or overwrites existing file) curl -X POST \ -H "Content-Type: application/octet-stream" \ -H "X-ApiKey: ${PROGET_API_KEY}" \ --data-binary "@${{ env.archive_path }}/${{ env.archive_filename }}" \ --fail-with-body \ "$PROGET_ENDPOINT" - + if [ $? -eq 0 ]; then echo "Successfully uploaded ${{ env.archive_filename }} to ProGet" else echo "Failed to upload ${{ env.archive_filename }} to ProGet" exit 1 fi - - From 46ccef99e930554baa531fb863f1fe971b9aa54e Mon Sep 17 00:00:00 2001 From: Manish Maharjan Date: Fri, 26 Sep 2025 15:39:09 +0100 Subject: [PATCH 3/3] DO-1298 linting --- .github/workflows/build-base-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-base-python.yml b/.github/workflows/build-base-python.yml index b8f66c8..6be7bb3 100644 --- a/.github/workflows/build-base-python.yml +++ b/.github/workflows/build-base-python.yml @@ -112,7 +112,7 @@ jobs: PROGET_ASSET_DIRECTORY: ${{ vars.PROGET_ASSET_DIRECTORY }} run: | PROGET_ENDPOINT="${PROGET_BASE_URL}/endpoints/${PROGET_ASSET_DIRECTORY}/content/base_python/${{ env.shortversion }}/${{ env.archive_filename }}" - + curl -X POST \ -H "Content-Type: application/octet-stream" \ -H "X-ApiKey: ${PROGET_API_KEY}" \