Skip to content

Commit

Permalink
Adds GitHub service connection to pipelines release task
Browse files Browse the repository at this point in the history
Try a different environment variable to get AP_VERSION in script

Fix ap version var in release script

remove old tagging script

rename artifacts to have version name in them

Change tag source to manual

Try again, now specify target for release

[release]

Work done for #196

Disable githubrelease task auto notes

Also correct asset directory
  • Loading branch information
atruskie committed Apr 7, 2020
1 parent d1629bc commit 1a273de
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 47 deletions.
27 changes: 17 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ stages:
$is_manual_release = $commit_message -ilike '*`[release`]*'
$ci_do_release = $env:CI_DO_RELEASE
Write-Output "CI_DO_RELEASE: $ci_do_release"
$is_variable_release = $ci_do_release.Length -gt 0
$is_variable_release = $null -ne $ci_do_release -and $ci_do_release -ne ''
$is_weekly_release = '$(Build.Reason)' -ieq 'Schedule'
$should_release = $is_weekly_release -or $is_manual_release -or $is_variable_release
Write-Output "##vso[task.setvariable variable=isManualRelease;isOutput=true]$is_manual_release"
Expand All @@ -61,7 +61,6 @@ stages:
displayName: Get commit message and calculate release variables
env:
AUDIO_ANALYSIS_CI: $(AUDIO_ANALYSIS_CI)
CI_DO_RELEASE: $[CI_DO_RELEASE]
- job: doRelease
dependsOn: checkRelease
displayName: Release
Expand Down Expand Up @@ -93,24 +92,32 @@ stages:
- pwsh: |
git checkout $env:BUILD_SOURCEBRANCHNAME
./build/release_notes.ps1 v${env:AP_VERSION} '$(System.ArtifactsDirectory)/release_notes.txt' -update_changelog
Get-ChildItem env:
./build/release_notes.ps1 v${env:AP_Version} '$(System.ArtifactsDirectory)/release_notes.txt' -update_changelog
git config --global user.email "[email protected]"
git config --global user.name "QUT Ecoaocustics"
git config --global user.email "[email protected]"
git config --global user.name "QUT Ecoacoustics"
git add CHANGELOG.md
git commit -m "Update changelog for v${env:AP_Version}" -m "[skip_ci]"
displayName: Generate release notes, commit changelog
git commit -m "Update changelog for v${env:AP_VERSION}" -m "[skip ci]"
git tag -a -m "Version ${env:AP_VERSION}" "v${env:AP_VERSION}"
git push --follow-tags
$release_target = git rev-parse --verify HEAD
Write-Output "##vso[task.setvariable variable=AP_ReleaseTarget]$release_target"
displayName: Generate release notes, commit changelog, tag, and push
- task: GitHubRelease@0
inputs:
# managed here https://dev.azure.com/QutEcoacoustics/audio-analysis/_settings/adminservices
gitHubConnection: github.com_atruskie
action: create
tagSource: auto
tagSource: manual
target: $(AP_ReleaseTarget)
tag: v$(AP_Version)
title: $(AP_ReleaseTitle)
releaseNotesSource: file
releaseNotesFile: '$(System.ArtifactsDirectory)/release_notes.txt'
assets: |
$(Build.ArtifactsDirectory)/**/*.zip
$(Build.ArtifactsDirectory)/**/*.tar.xz
$(System.ArtifactsDirectory)/**/*.zip
$(System.ArtifactsDirectory)/**/*.tar.xz
isDraft: true
isPreRelease: true
addChangeLog: false
4 changes: 2 additions & 2 deletions build/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ jobs:
includeRootFolder: false
${{ if startsWith(platform.pool, 'windows') }}:
archiveType: zip
archiveFile: '$(Build.ArtifactStagingDirectory)/AP_$(platformTag)$(configurationTag)_$(Build.BuildNumber).zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/AP_$(platformTag)$(configurationTag)_v$(AP_Version).zip'
${{ if not(startsWith(platform.pool, 'windows')) }}:
archiveType: tar
tarCompression: xz
archiveFile: '$(Build.ArtifactStagingDirectory)/AP_$(platformTag)$(configurationTag)_$(Build.BuildNumber).tar.xz'
archiveFile: '$(Build.ArtifactStagingDirectory)/AP_$(platformTag)$(configurationTag)_v$(AP_Version).tar.xz'

displayName: Archive published app

Expand Down
3 changes: 2 additions & 1 deletion build/release_notes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function formatIssueList {
" - "
}
else {
$issues | Join-String { "[$_](https://github.com/QutEcoacoustics/audio-analysis/issues/" + $_.TrimStart("#") + ")" } -Separator ", " -OutputPrefix " - (" -OutputSuffix ")`n "
# disabled code "nice" hard wrap because markdown was rendering with a newline in github release notes
$issues | Join-String { "[$_](https://github.com/QutEcoacoustics/audio-analysis/issues/" + $_.TrimStart("#") + ")" } -Separator ", " -OutputPrefix " - (" -OutputSuffix ") "
}

return "- " + ($_.Title -replace " - ", $issue_string)
Expand Down
34 changes: 0 additions & 34 deletions build/tag.ps1

This file was deleted.

0 comments on commit 1a273de

Please sign in to comment.