# Go # Build your Go project. # Add steps that test, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/go trigger: tags: include: - refs/tags/v* branches: exclude: - master pool: vmImage: 'ubuntu-latest' variables: GOBIN: '$(GOPATH)/bin' # Go binaries path GOROOT: '$(Agent.BuildDirectory)/go' # Go installation path GOPATH: '$(Agent.BuildDirectory)/gopath' # Go workspace path modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code steps: - script: | mkdir -p '$(GOBIN)' mkdir -p '$(GOPATH)/pkg' mkdir -p '$(modulePath)' shopt -s extglob shopt -s dotglob mv !(gopath) '$(modulePath)' echo '##vso[task.prependpath]$(GOBIN)' echo '##vso[task.prependpath]$(GOROOT)/bin' wget "https://golang.org/dl/go1.15.2.linux-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.15.2.tar.gz" tar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.15.2.tar.gz" displayName: 'Set up the Go workspace' - script: | v="$(git describe --tags)" ./release.sh mv ./release/* $(Build.ArtifactStagingDirectory)/ workingDirectory: '$(modulePath)' displayName: 'Get dependencies, then build' # GitHub Release # Create, edit, or delete a GitHub release - task: GitHubRelease@0 inputs: gitHubConnection: github.com_cbeuw repositoryName: '$(Build.Repository.Name)' action: 'create' # Options: create, edit, delete target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit tagSource: 'auto' # Required when action == Create# Options: auto, manual #tagPattern: # Optional #tag: "$(git describe --tags)" # Required when action == Edit || Action == Delete || TagSource == Manual #title: # Optional #releaseNotesSource: 'file' # Optional. Options: file, input #releaseNotesFile: # Optional #releaseNotes: # Optional #assets: '$(Build.ArtifactStagingDirectory)/*' # Optional #assetUploadMode: 'delete' # Optional. Options: delete, replace #isDraft: false # Optional #isPreRelease: false # Optional addChangeLog: false # Optional #compareWith: 'lastFullRelease' # Required when addChangeLog == True. Options: lastFullRelease, lastRelease, lastReleaseByTag #releaseTag: # Required when compareWith == LastReleaseByTag