|
28 | 28 | required: false |
29 | 29 | default: '' |
30 | 30 | type: string |
31 | | - enableArtifactoryPip: |
32 | | - description: 'Enable PIP access to artifactory' |
| 31 | + enableArtifactory: |
| 32 | + description: 'Upload to artifactory instead of PyPi' |
33 | 33 | required: false |
34 | 34 | default: false |
35 | 35 | type: boolean |
36 | 36 | enableUploadDocker: |
37 | 37 | description: 'Enable docker upload step. NOTE: Docker images will only be uploaded if the build is on a tag.' |
38 | 38 | required: false |
| 39 | + default: false |
39 | 40 | type: boolean |
40 | 41 | secrets: |
41 | 42 | COMMONTOOLING_DEPLOY_KEY: |
@@ -121,18 +122,6 @@ jobs: |
121 | 122 | - name: Create pip conf |
122 | 123 | run: touch ${{ github.workspace }}/.pip.conf |
123 | 124 |
|
124 | | - - name: ${{ format('{0}Configure Artifactory PIP registry', ((!inputs.enableArtifactoryPip) && 'NOT ENABLED | ' || '') ) }} |
125 | | - if: ${{ inputs.enableArtifactoryPip }} |
126 | | - run: | |
127 | | - touch ${{ github.workspace }}/.pip.conf |
128 | | - cat <<EOF >> ${{ github.workspace }}/.pip.conf |
129 | | - [global] |
130 | | - extra-index-url = https://${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_TOKEN }}@api.artifactory.labs.bbc/artifactory/api/pypi/ap-python/simple/ |
131 | | -
|
132 | | - [search] |
133 | | - extra-index = https://${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_TOKEN }}@api.artifactory.labs.bbc/artifactory/api/pypi/ap-python/ |
134 | | - EOF |
135 | | -
|
136 | 125 | ############### |
137 | 126 | ## Run tests ## |
138 | 127 | ############### |
@@ -162,12 +151,20 @@ jobs: |
162 | 151 | ################################# |
163 | 152 | ## Upload deployable artefacts ## |
164 | 153 | ################################# |
165 | | - - name: Upload wheels |
166 | | - if: ${{ startsWith(env.CHECKOUT_REF, 'refs/tags/') }} |
| 154 | + - name: ${{ format('{0}Upload wheels to PyPi', ((inputs.enableArtifactory) && 'NOT ENABLED | ' || '') ) }} |
| 155 | + if: ${{ (!inputs.enableArtifactory) && startsWith(env.CHECKOUT_REF, 'refs/tags/') }} |
167 | 156 | uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10 |
168 | 157 | with: |
169 | 158 | skip-existing: true |
170 | 159 |
|
| 160 | + - name: ${{ format('{0}Upload wheels to Artifactory', ((!inputs.enableArtifactory) && 'NOT ENABLED | ' || '') ) }} |
| 161 | + if: ${{ inputs.enableArtifactory && startsWith(env.CHECKOUT_REF, 'refs/tags/') }} |
| 162 | + env: |
| 163 | + TWINE_REPO: ${{ secrets.ARTIFACTORY_REPO }} |
| 164 | + TWINE_REPO_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} |
| 165 | + TWINE_REPO_PASSWORD: ${{ secrets.ARTIFACTORY_TOKEN }} |
| 166 | + run: make upload-wheels |
| 167 | + |
171 | 168 | - name: ${{ format('{0}Upload docker images', ((! inputs.enableUploadDocker) && 'NOT ENABLED | ' || '') ) }} |
172 | 169 | if: ${{ inputs.enableUploadDocker && startsWith(env.CHECKOUT_REF, 'refs/tags/') }} |
173 | 170 | run: make upload-docker |
@@ -203,7 +200,7 @@ jobs: |
203 | 200 | environment: |
204 | 201 | name: github-pages |
205 | 202 | url: ${{ steps.deployment.outputs.page_url }} |
206 | | - if: ${{ inputs.forceDocsUpload || startsWith(inputs.checkoutRef == '' && github.ref || inputs.checkoutRef, 'refs/tags/') }} |
| 203 | + if: ${{ startsWith(inputs.checkoutRef == '' && github.ref || inputs.checkoutRef, 'refs/tags/') }} |
207 | 204 | steps: |
208 | 205 | - name: Deploy documentation to GitHub Pages |
209 | 206 | id: deployment |
|
0 commit comments