Skip to content

Commit

Permalink
Archive
Browse files Browse the repository at this point in the history
  • Loading branch information
paulvarache committed Jan 28, 2020
1 parent e2a8c72 commit e0c027f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vars:
APP_NAME: taskfile_language_server
HASH: $(git rev-parse --short HEAD)
VERSION: 0.0.0
OUTPUT: dist/{{.APP_NAME}}_{{OS}}_{{ARCH}}{{exeExt}}
OUTPUT: dist/{{.APP_NAME}}_{{OS}}_{{ARCH}}

tasks:

Expand All @@ -17,7 +17,7 @@ tasks:

build:release:
cmds:
- go build -ldflags="-X 'main.BuildVersion={{.VERSION}}' -X 'main.BuildHash={{.HASH}}'" -o {{.OUTPUT}}
- go build -ldflags="-X 'main.BuildVersion={{.VERSION}}' -X 'main.BuildHash={{.HASH}}'" -o {{.OUTPUT}}{{exeExt}}

get-output:
cmds:
Expand Down
26 changes: 25 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
archiveType: zip
archiveExt: .zip
mac:
imageName: 'macos-10.13'
archiveType: tar
archiveExt: .tar.gz
windows:
imageName: 'vs2017-win2016'
archiveType: tar
archiveExt: .tar.gz

pool:
vmImage: $(imageName)
Expand Down Expand Up @@ -43,14 +49,32 @@ steps:
echo "##vso[task.setvariable variable=tag]$tag"
displayName: Get tag

- task: CopyFiles@2
inputs:
Contents: |
README.md
LICENSE
TargetFolder: 'dist'
displayName: Copy Readme.md and LICENSE

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'dist'
includeRootFolder: false
archiveType: $(archiveType)
archiveFile: '$(Build.ArtifactStagingDirectory)/$(task get-output).$(archiveExt))'
replaceExistingArchive: true
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
displayName: Archive

- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_paulvarache'
repositoryName: '$(Build.Repository.Name)'
action: 'edit'
target: '$(Build.SourceVersion)'
tag: $(tag)
assets: 'dist/**/*'
assets: '$(Build.ArtifactStagingDirectory)/*'
assetUploadMode: 'replace'
addChangeLog: false
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
Expand Down

0 comments on commit e0c027f

Please sign in to comment.