Skip to content

Commit

Permalink
Create version.txt in pipeline (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen authored Nov 22, 2020
1 parent f9854a4 commit 552570b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
displayName: 'Build Release'
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'assembleRelease'
tasks: 'assembleRelease versionTxt'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
javaHomeOption: 'JDKVersion'
Expand All @@ -73,6 +73,13 @@ jobs:
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true

- task: CopyFiles@2
displayName: 'Copy version.txt'
inputs:
SourceFolder: 'app/build/'
Contents: 'version.txt'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Publish APKs'
inputs:
Expand Down Expand Up @@ -138,4 +145,4 @@ jobs:
inputs:
sshEndpoint: repository
runOptions: 'inline'
inline: 'cd /srv/repository/releases/client/android && rm -rf *.apk && ln -s versions/$(JELLYFIN_VERSION)/jellyfin-android-$(JELLYFIN_VERSION)-*.apk .'
inline: 'cd /srv/repository/releases/client/android && rm -rf *.apk version.txt && ln -s versions/$(JELLYFIN_VERSION)/jellyfin-android-$(JELLYFIN_VERSION)-*.apk . && ln -s versions/$(JELLYFIN_VERSION)/version.txt .'
10 changes: 10 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,13 @@ tasks.withType<DependencyUpdatesTask> {
Dependencies.Versions.isStable(currentVersion)
}
}

tasks.register("versionTxt") {
val path = buildDir.resolve("version.txt")

doLast {
val versionString = "v${android.defaultConfig.versionName}=${android.defaultConfig.versionCode}"
println("Writing [$versionString] to $path")
path.writeText("$versionString\n")
}
}

0 comments on commit 552570b

Please sign in to comment.