From a17b5d2017a64243fbc454f6ad6f57197ec63cb3 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 19 Jan 2024 14:24:22 +0000 Subject: [PATCH 1/3] Package upload: split build and upload, so we can upload twice Upload to mantid and mantidimaging repos --- .github/actions/publish-package/action.yml | 13 +++++++++++-- .github/workflows/conda.yml | 3 ++- .github/workflows/windows.yml | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/actions/publish-package/action.yml b/.github/actions/publish-package/action.yml index f5e9779308e..66d2f12bf6f 100644 --- a/.github/actions/publish-package/action.yml +++ b/.github/actions/publish-package/action.yml @@ -4,6 +4,10 @@ inputs: repository: description: 'Anaconda repository' required: true + default: 'mantidimaging' + repository-old: + description: 'Anaconda repository - old' + required: true default: 'mantid' label: description: 'Label' @@ -12,6 +16,9 @@ inputs: token: description: 'Anaconda API Token' required: true + token-old: + description: 'Anaconda API Token - old' + required: true description: Build conda package runs: @@ -35,8 +42,10 @@ runs: shell: bash -l {0} run: | conda activate build-env - conda config --set anaconda_upload yes + conda config --set anaconda_upload no # if the upload silently fails - check the token expiration. Conda can fail silently! - conda mambabuild --user ${{ inputs.repository }} --token ${{ inputs.token }} --label ${{ inputs.label }} $GITHUB_WORKSPACE/conda |& tee upload.log + conda mambabuild $GITHUB_WORKSPACE/conda + anaconda -t ${{ inputs.token }} upload --user ${{ inputs.repository }} --label ${{ inputs.label }} ${CONDA_PREFIX}/conda-bld/*/mantidimaging*.tar.bz2 |& tee upload.log + anaconda -t ${{ inputs.token-old }} upload --user ${{ inputs.repository-old }} --label ${{ inputs.label }} ${CONDA_PREFIX}/conda-bld/*/mantidimaging*.tar.bz2 # Check that upload completed grep "Upload complete" upload.log diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 97ab5ddac69..2b49c072632 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -140,4 +140,5 @@ jobs: uses: ./.github/actions/publish-package with: label: unstable - token: ${{ secrets.ANACONDA_API_TOKEN }} + token: ${{ secrets.ANACONDA_API_TOKEN_MANTIDIMAGING }} + token-old: ${{ secrets.ANACONDA_API_TOKEN }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e9f8d744428..9be6283e12a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -126,4 +126,5 @@ jobs: uses: ./.github/actions/publish-package with: label: unstable - token: ${{ secrets.ANACONDA_API_TOKEN }} + token: ${{ secrets.ANACONDA_API_TOKEN_MANTIDIMAGING }} + token-old: ${{ secrets.ANACONDA_API_TOKEN }} From 12b8e0cf7eee6370cd5d96654ff941526d631c89 Mon Sep 17 00:00:00 2001 From: Mike Sullivan Date: Wed, 24 Jan 2024 17:05:46 +0000 Subject: [PATCH 2/3] PR test --- .github/workflows/conda.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 2b49c072632..e41c7294da0 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -139,6 +139,6 @@ jobs: if: github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release'))) uses: ./.github/actions/publish-package with: - label: unstable + label: upload-test-mike token: ${{ secrets.ANACONDA_API_TOKEN_MANTIDIMAGING }} token-old: ${{ secrets.ANACONDA_API_TOKEN }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9be6283e12a..ad477181483 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -125,6 +125,6 @@ jobs: if: github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release'))) uses: ./.github/actions/publish-package with: - label: unstable + label: upload-test-mike token: ${{ secrets.ANACONDA_API_TOKEN_MANTIDIMAGING }} token-old: ${{ secrets.ANACONDA_API_TOKEN }} From da46ae5a047c23640de4c33181d61c4bde1454d3 Mon Sep 17 00:00:00 2001 From: Mike Sullivan Date: Wed, 24 Jan 2024 17:19:56 +0000 Subject: [PATCH 3/3] PR test2 --- .github/workflows/conda.yml | 1 - .github/workflows/windows.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index e41c7294da0..0484e8b8a34 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -136,7 +136,6 @@ jobs: # Always label as unstable. Builds of stable releases can be manually labeled to 'main' once tested - name: publish 'unstable' package - if: github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release'))) uses: ./.github/actions/publish-package with: label: upload-test-mike diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ad477181483..bdcb33157f8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -122,7 +122,6 @@ jobs: # Label as 'windows-build-test' for testing purposes. # To re-enable, use the if rule from the conda workflow and change label to 'unstable' after testing - name: publish package - if: github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release'))) uses: ./.github/actions/publish-package with: label: upload-test-mike