Fix updating github release (#259)
This commit is contained in:
committed by
GitHub
parent
b10f8cf322
commit
f2a65f1f7a
@@ -220,7 +220,10 @@ jobs:
|
|||||||
dependsOn: Build
|
dependsOn: Build
|
||||||
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
|
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
|
||||||
steps:
|
steps:
|
||||||
- checkout: none
|
# Checking out the sources is needed to be able to delete the "dev" tag, see below.
|
||||||
|
- checkout: self
|
||||||
|
persistCredentials: true
|
||||||
|
submodules: false
|
||||||
- task: DownloadPipelineArtifact@1
|
- task: DownloadPipelineArtifact@1
|
||||||
inputs:
|
inputs:
|
||||||
targetPath: $(Build.ArtifactStagingDirectory)
|
targetPath: $(Build.ArtifactStagingDirectory)
|
||||||
@@ -230,7 +233,6 @@ jobs:
|
|||||||
- task: GitHubRelease@0
|
- task: GitHubRelease@0
|
||||||
inputs:
|
inputs:
|
||||||
gitHubConnection: 'tschneidereit-releases'
|
gitHubConnection: 'tschneidereit-releases'
|
||||||
repositoryName: 'cranestation/wasmtime'
|
|
||||||
target: '$(Build.SourceVersion)'
|
target: '$(Build.SourceVersion)'
|
||||||
tagSource: 'manual'
|
tagSource: 'manual'
|
||||||
tag: '$(tagName)'
|
tag: '$(tagName)'
|
||||||
@@ -239,17 +241,30 @@ jobs:
|
|||||||
isDraft: false
|
isDraft: false
|
||||||
isPreRelease: true
|
isPreRelease: true
|
||||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||||
|
|
||||||
|
# GitHub doesn't support doing rolling releases for branch.
|
||||||
|
# To simulate that for dev builds, always do a release for the "dev" tag.
|
||||||
|
# While the `edit` action for the GitHubRelease task would replace any assets
|
||||||
|
# associated with the tag, it wouldn't update the tag itself. Hence, delete the
|
||||||
|
# tag if it exists, and re-create it every time.
|
||||||
|
# Also explicitly delete the GitHub release, which would otherwise turn into a draft
|
||||||
|
# and linger forever.
|
||||||
- task: GitHubRelease@0
|
- task: GitHubRelease@0
|
||||||
inputs:
|
inputs:
|
||||||
gitHubConnection: 'tschneidereit-releases'
|
gitHubConnection: 'tschneidereit-releases'
|
||||||
repositoryName: 'cranestation/wasmtime'
|
|
||||||
action: 'delete'
|
action: 'delete'
|
||||||
tag: 'dev'
|
tag: 'dev'
|
||||||
|
# This might fail in case the target repo doesn't yet have this tag, which is fine.
|
||||||
|
continueOnError: true
|
||||||
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
- script: |
|
||||||
|
git -c http.extraheader="AUTHORIZATION: basic ***" push origin :dev
|
||||||
|
# This might fail in case the target repo doesn't yet have this tag, which is fine.
|
||||||
|
continueOnError: true
|
||||||
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
- task: GitHubRelease@0
|
- task: GitHubRelease@0
|
||||||
inputs:
|
inputs:
|
||||||
gitHubConnection: 'tschneidereit-releases'
|
gitHubConnection: 'tschneidereit-releases'
|
||||||
repositoryName: 'cranestation/wasmtime'
|
|
||||||
action: 'create'
|
action: 'create'
|
||||||
target: '$(Build.SourceVersion)'
|
target: '$(Build.SourceVersion)'
|
||||||
tag: 'dev'
|
tag: 'dev'
|
||||||
|
|||||||
Reference in New Issue
Block a user