fix release job (#9166)

Three issues here:

1. The release job runs on an Azure-hosted agent, so it doesn't have the
   `reset_caches.sh` script (and doesn't need it).
2. The `bash-lib` step should not run if the current job has already
   failed.
3. The `skip-github` jobs should also not run if the job  has failed.

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Gary Verhaegen 2021-03-17 10:46:02 +01:00 committed by GitHub
parent f6effb228a
commit 17f8bcd37d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -62,7 +62,6 @@ jobs:
set -euo pipefail set -euo pipefail
git checkout $(release_sha) git checkout $(release_sha)
name: checkout_release name: checkout_release
- template: ci/clean-up.yml
- template: ci/bash-lib.yml - template: ci/bash-lib.yml
parameters: parameters:
var_name: bash-lib var_name: bash-lib
@ -79,17 +78,17 @@ jobs:
inputs: inputs:
artifactName: linux-release artifactName: linux-release
targetPath: $(Build.StagingDirectory)/release-artifacts targetPath: $(Build.StagingDirectory)/release-artifacts
condition: not(eq(variables['skip-github'], 'TRUE')) condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
- task: DownloadPipelineArtifact@0 - task: DownloadPipelineArtifact@0
inputs: inputs:
artifactName: macos-release artifactName: macos-release
targetPath: $(Build.StagingDirectory)/release-artifacts targetPath: $(Build.StagingDirectory)/release-artifacts
condition: not(eq(variables['skip-github'], 'TRUE')) condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
- task: DownloadPipelineArtifact@0 - task: DownloadPipelineArtifact@0
inputs: inputs:
artifactName: windows-release artifactName: windows-release
targetPath: $(Build.StagingDirectory)/release-artifacts targetPath: $(Build.StagingDirectory)/release-artifacts
condition: not(eq(variables['skip-github'], 'TRUE')) condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
- bash: | - bash: |
set -euo pipefail set -euo pipefail
KEY_FILE=$(mktemp) KEY_FILE=$(mktemp)
@ -128,13 +127,13 @@ jobs:
isPrerelease: true isPrerelease: true
releaseNotesSource: 'input' releaseNotesSource: 'input'
releaseNotes: "This is a pre-release. Use at your own risk." releaseNotes: "This is a pre-release. Use at your own risk."
condition: not(eq(variables['skip-github'], 'TRUE')) condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
- bash: | - bash: |
set -euo pipefail set -euo pipefail
./ci/publish-artifactory.sh $(Build.StagingDirectory) $(release_tag) ./ci/publish-artifactory.sh $(Build.StagingDirectory) $(release_tag)
env: env:
AUTH: $(ARTIFACTORY_USERNAME):$(ARTIFACTORY_PASSWORD) AUTH: $(ARTIFACTORY_USERNAME):$(ARTIFACTORY_PASSWORD)
condition: not(eq(variables['skip-github'], 'TRUE')) condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
- bash: | - bash: |
set -euo pipefail set -euo pipefail
@ -152,7 +151,7 @@ jobs:
name: backup_to_gcs name: backup_to_gcs
env: env:
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT) GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
condition: not(eq(variables['skip-github'], 'TRUE')) condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
- bash: | - bash: |
set -euo pipefail set -euo pipefail
msg=$(git log -n1 --format=%b HEAD | head -1) msg=$(git log -n1 --format=%b HEAD | head -1)

View File

@ -152,4 +152,3 @@ steps:
END END
echo "##vso[task.setvariable variable=${{parameters.var_name}}]$TMP" echo "##vso[task.setvariable variable=${{parameters.var_name}}]$TMP"
displayName: install Bash lib displayName: install Bash lib
condition: always()