Skip to content

Commit

Permalink
Archive files before release
Browse files Browse the repository at this point in the history
  • Loading branch information
paulvarache committed Jan 28, 2020
1 parent e2a8c72 commit 6c517af
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2020 Paul Varache Ltd.,
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down
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: "{{.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 ./dist/{{.OUTPUT}}{{exeExt}}

get-output:
cmds:
Expand Down
47 changes: 32 additions & 15 deletions 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: tar
archiveExt: .tar.gz
mac:
imageName: 'macos-10.13'
archiveType: tar
archiveExt: .tar.gz
windows:
imageName: 'vs2017-win2016'
archiveType: zip
archiveExt: .zip

pool:
vmImage: $(imageName)
Expand All @@ -19,38 +25,49 @@ steps:
inputs:
version: '1.13.6'

- task: Bash@3
- task: UseTaskfile@0
inputs:
filePath: './ci/install-task.sh'
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Install task

- bash: brew install go-task/tap/go-task
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: Install task

- task: PowerShell@2
inputs:
filePath: './ci/install-task.ps1'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Install task
version: '2.8'

- script: task build:release
displayName: Build binary

- powershell: |
$output = task get-output
echo "##vso[task.setvariable variable=output]$output"
displayName: Get target output

- powershell: |
$tag = "$(Build.SourceBranch)" -replace "refs/tags/", ""
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)/$(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
13 changes: 0 additions & 13 deletions ci/install-task.ps1

This file was deleted.

3 changes: 0 additions & 3 deletions ci/install-task.sh

This file was deleted.

0 comments on commit 6c517af

Please sign in to comment.