diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4afee7f..b0a35a3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,9 +7,17 @@ jobs: - script: curl -sSL https://get.haskellstack.org/ | sh displayName: Install stack + - script: stack build --flag fake-json:-static + displayName: Build + - script: stack test displayName: Run tests + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'fake-json-linux-x86_64' + targetPath: '.stack-work/install/x86_64-linux/lts-12.20/8.4.4/bin/' + - job: MacOSTest pool: vmImage: 'macOS-10.13' @@ -17,9 +25,17 @@ jobs: - script: curl -sSL https://get.haskellstack.org/ | sh displayName: Install stack + - script: stack build --flag fake-json:-static + displayName: Build + - script: stack test displayName: Run tests + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'fake-json-osx-x86_64' + targetPath: '.stack-work/install/x86_64-osx/lts-12.20/8.4.4/bin/' + - job: WindowsTest pool: vmImage: 'VS2017-Win2016' @@ -27,5 +43,47 @@ jobs: - script: choco install haskell-stack displayName: Install stack + - script: stack build --flag fake-json:-static + displayName: Build + - script: stack test displayName: Run tests + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'fake-json-windows-x86_64' + targetPath: '.stack-work\install\ad603a72\bin' + + - job: Release + dependsOn: + - LinuxTest + - MacOSTest + - WindowsTest + + steps: + - script: mkdir -p $(System.DefaultWorkingDirectory)/artifacts/ + - task: DownloadPipelineArtifact@0 + inputs: + artifactName: 'fake-json-windows-x86_64' + targetPath: $(System.DefaultWorkingDirectory)/artifacts/ + + - task: DownloadPipelineArtifact@0 + inputs: + artifactName: 'fake-json-osx-x86_64' + targetPath: $(System.DefaultWorkingDirectory)/artifacts/ + - script: mv $(System.DefaultWorkingDirectory)/artifacts/fake-json{,-osx-x86_64} + + - task: DownloadPipelineArtifact@0 + inputs: + artifactName: 'fake-json-linux-x86_64' + targetPath: $(System.DefaultWorkingDirectory)/artifacts/ + - script: mv $(System.DefaultWorkingDirectory)/artifacts/fake-json{,-linux-x86_64} + + - task: GithubRelease@0 + inputs: + gitHubConnection: 'GitHub connection' + repositoryName: mfussenegger/fake-json + target: '$(build.sourceVersion)' + assets: $(System.DefaultWorkingDirectory)/artifacts/* + tagSource: 'auto' + isDraft: true diff --git a/package.yaml b/package.yaml index 2b43c21..69bf03a 100644 --- a/package.yaml +++ b/package.yaml @@ -49,6 +49,12 @@ executables: - -rtsopts dependencies: - fake-json + when: + - condition: flag(static) + ld-options: + - -static + ghc-options: + - fPIC tests: fake-json-test: @@ -67,3 +73,9 @@ tests: - fake-json - Glob - doctest + +flags: + static: + description: Pass -static to ghc when linking the binary. + manual: true + default: false