Skip to content

Commit

Permalink
Fix publishing by flattening directory first (#964)
Browse files Browse the repository at this point in the history
* Add publish task to azure

* Fix typo

* more typos

* Fix job title

* update connection name

* Testing pipeline artifact

* Add non-cuda builds

* Different artifact name for cuda

* Include OS information in installer file names

eg GRIP-v1.0.0-linux_x86.deb

* Remove Mac CUDA publishing

Macs have not have Nvidia GPUs in years and the latest version of macOS breaks the nvidia driver for older macs

* use compile time stage check

Co-authored-by: Sam Carlberg <[email protected]>
  • Loading branch information
AustinShalit and SamCarlberg authored Jun 13, 2020
1 parent e8d1987 commit 04de723
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 77 deletions.
119 changes: 43 additions & 76 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,28 @@ stages:
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
tasks: 'check :ui:jpackage -Pgeneration -PjniLocation=build/OpenCVJNI -Pheadless=true -PlogTests -Pjdk14=/opt/java/jdk-14 --stacktrace'
- task: CopyFiles@2
- task: PublishPipelineArtifact@1
inputs:
contents: 'ui/build/installer/GRIP-*.deb'
targetFolder: $(Build.ArtifactStagingDirectory)
targetPath: 'ui/build/installer'
artifactName: 'LinuxInstaller'
- script: |
export GH_TOKEN=$(GH_TOKEN)
.azure-scripts/push-javadoc-to-gh-pages.sh
displayName: 'Publish Javadocs'
condition: |
and(not(eq(variables['Build.Reason'], 'PullRequest')),
eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
tasks: ':ui:jpackage -Pcuda -Pjdk14=/opt/java/jdk-14 --stacktrace'
- task: CopyFiles@2
- task: PublishPipelineArtifact@1
inputs:
contents: 'ui/build/installer/GRIP-*.deb'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
inputs:
artifactName: 'LinuxInstaller'
targetPath: 'ui/build/installer'
artifactName: 'LinuxInstaller-cuda'

- job: Windows_64_Bit
pool:
Expand Down Expand Up @@ -95,26 +90,21 @@ stages:
jdkArchitectureOption: 'x64'
publishJUnitResults: true
tasks: 'check :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -PskipUITests -Pjdk14=..\build\jdk-14 --stacktrace'
- task: CopyFiles@2
- task: PublishPipelineArtifact@1
inputs:
contents: 'ui\build\installer\GRIP-*.exe'
targetFolder: $(Build.ArtifactStagingDirectory)

targetPath: 'ui/build/installer'
artifactName: 'Win64Installer'
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
tasks: ':ui:jpackage -Pcuda -PskipUITests -Pjdk14=..\build\jdk-14 --stacktrace'
- task: CopyFiles@2
inputs:
contents: 'ui\build\installer\GRIP-*.exe'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
- task: PublishPipelineArtifact@1
inputs:
artifactName: 'Win64Installer'
targetPath: 'ui/build/installer'
artifactName: 'Win64Installer-cuda'

- job: Windows_32_Bit
pool:
Expand Down Expand Up @@ -157,13 +147,9 @@ stages:
# publishJUnitResults: false
# tasks: ':ui:jpackage -Pcuda -PskipUITests -Pjdk14=..\build\jdk-14 --stacktrace'

- task: CopyFiles@2
inputs:
contents: 'ui\build\installer\GRIP-*.exe'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'ui/build/installer'
artifactName: 'Win32Installer'

- job: Mac
Expand All @@ -188,59 +174,40 @@ stages:
jdkArchitectureOption: 'x64'
publishJUnitResults: false
tasks: 'check jacocoTestReport jacocoRootReport :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -Pjdk14=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/ --stacktrace'
- task: CopyFiles@2
- task: PublishPipelineArtifact@1
inputs:
contents: 'ui/build/installer/*'
targetFolder: $(Build.ArtifactStagingDirectory)
targetPath: 'ui/build/installer'
artifactName: 'MacInstaller'

- script: |
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
./.codecov -t $(CODECOV_TOKEN)
displayName: 'Upload jacoco reports to codecov'
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
tasks: ':ui:jpackage -Pcuda -Pjdk14=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/ --stacktrace'

- task: CopyFiles@2
inputs:
contents: 'ui/build/installer/*'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
inputs:
artifactName: 'MacInstaller'

- stage: Publish
jobs:
- job: UploadGitHubRelease

pool:
vmImage: 'Ubuntu 16.04'

condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
steps:
- task: DownloadPipelineArtifact@2
displayName: Download artifacts
inputs:
path: $(Build.ArtifactStagingDirectory)

- task: GitHubRelease@0
displayName: Create GitHub Release
inputs:
gitHubConnection: 'GRIP GitHub Connection'
repositoryName: $(Build.Repository.Name)
action: edit
target: $(Build.SourceVersion)
tagSource: auto
tag: $(Build.SourceBranchName)
assetUploadMode: 'replace'
isDraft: true
addChangeLog: true
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/v') }}:
- stage: Publish
jobs:
- job: UploadGitHubRelease

pool:
vmImage: 'Ubuntu 16.04'

steps:
- task: DownloadPipelineArtifact@2
displayName: Download artifacts
inputs:
path: $(Build.ArtifactStagingDirectory)

- task: GitHubRelease@0
displayName: Create GitHub Release
inputs:
gitHubConnection: 'GRIP GitHub Connection'
repositoryName: $(Build.Repository.Name)
action: edit
target: $(Build.SourceVersion)
tagSource: auto
tag: $(Build.SourceBranchName)
assetUploadMode: 'replace'
isDraft: true
addChangeLog: true
2 changes: 1 addition & 1 deletion ui/ui.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ tasks.register<JpackageExec>("jpackage") {

val projectVersion = "${project.version}"
applicationVersion.set(projectVersion.drop(1).takeWhile { it != '-' }) // 'v1.5.2-abfa51a' -> '1.5.2'
fullApplicationVersion.set(projectVersion)
fullApplicationVersion.set(projectVersion + "-" + osdetector.classifier)
copyright.set("Copyright (c) 2015-2019 WPI")
licenseFile.set(rootDir.resolve("LICENSE.txt"))
applicationVendor.set("Worcester Polytechnic Institute")
Expand Down

0 comments on commit 04de723

Please sign in to comment.