|
29 | 29 |
|
30 | 30 | steps: |
31 | 31 | - name: Checkout |
32 | | - uses: actions/checkout@v4 |
| 32 | + uses: actions/checkout@v5 |
33 | 33 |
|
34 | 34 | - name: Set output |
35 | 35 | id: set_output |
|
61 | 61 |
|
62 | 62 | steps: |
63 | 63 | - name: Checkout |
64 | | - uses: actions/checkout@v4 |
| 64 | + uses: actions/checkout@v5 |
65 | 65 |
|
66 | 66 | - name: Set up Python |
67 | 67 | uses: actions/setup-python@v5 |
@@ -102,3 +102,36 @@ jobs: |
102 | 102 | jfrog rt upload --flat \ |
103 | 103 | "${{ env.archive_path }}/${{ env.archive_filename }}" \ |
104 | 104 | "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