Skip to content

Commit

Permalink
Test conditional java publish
Browse files Browse the repository at this point in the history
  • Loading branch information
elx-cbrandom committed Jan 26, 2024
1 parent f9d3cff commit 97086b1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/java-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'ref/heads/release')
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: publish
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/python-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: python-client/dist/
packages-dir: python-client/dist/
- name: Publish release package to PyPI
if: startsWith(github.ref, 'ref/heads/release')
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python-client/dist/
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ ext {

currentJvm = org.gradle.internal.jvm.Jvm.current()

if (gitBranch == 'master') {
if (gitBranch == 'dev') {
println 'Building master branch'
project.version = getMasterVersion()
artifactoryRepo = 'libs-release-local'
project.version = getDevVersion()
artifactoryRepo = 'libs-snapshot-local'
} else {
branchVersionIdentifier = gitBranch.replaceAll("[\\W]", "_")
println 'Building branch: ' + branchVersionIdentifier
project.version = getBranchVersion(branchVersionIdentifier)
artifactoryRepo = 'libs-snapshot-local'
project.version = getReleaseVersion(branchVersionIdentifier)
artifactoryRepo = 'libs-release-local'
}

println 'Version: ' + project.version
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cachethq_client"
version = "0.1.3"
version = "0.1.4"
description = ""
authors = ["cbrand <chris.brandom@elyxor.com>"]
readme = "README.md"
Expand Down
6 changes: 3 additions & 3 deletions versioning.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ext {
patch = project.property('artifactPatchVersion')
buildNum = 'LOCAL'

getMasterVersion = {
getReleaseVersion = {
if (rootProject.hasProperty('teamcity')) {
teamcity['build.major'] = major
teamcity['build.minor'] = minor
Expand All @@ -29,7 +29,7 @@ ext {
return major + '.' + minor + '.' + buildNum
}

getBranchVersion = { branchName ->
return major + '.' + minor + '.' + patch + '-' + branchName + '-SNAPSHOT'
getDevVersion = { branchName ->
return major + '.' + minor + '.' + patch + '-SNAPSHOT'
}
}

0 comments on commit 97086b1

Please sign in to comment.