diff --git a/.github/workflows/java-build-and-publish.yml b/.github/workflows/java-build-and-publish.yml index 48f6155..57bfb3f 100644 --- a/.github/workflows/java-build-and-publish.yml +++ b/.github/workflows/java-build-and-publish.yml @@ -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 diff --git a/.github/workflows/python-build-and-publish.yml b/.github/workflows/python-build-and-publish.yml index 36920db..f9138fe 100644 --- a/.github/workflows/python-build-and-publish.yml +++ b/.github/workflows/python-build-and-publish.yml @@ -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/ \ No newline at end of file + 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/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 59b2efa..8473570 100644 --- a/build.gradle +++ b/build.gradle @@ -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 diff --git a/pyproject.toml b/pyproject.toml index bdf846d..4bb4d6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cachethq_client" -version = "0.1.3" +version = "0.1.4" description = "" authors = ["cbrand "] readme = "README.md" diff --git a/versioning.gradle b/versioning.gradle index 894b258..82b3fcd 100644 --- a/versioning.gradle +++ b/versioning.gradle @@ -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 @@ -29,7 +29,7 @@ ext { return major + '.' + minor + '.' + buildNum } - getBranchVersion = { branchName -> - return major + '.' + minor + '.' + patch + '-' + branchName + '-SNAPSHOT' + getDevVersion = { branchName -> + return major + '.' + minor + '.' + patch + '-SNAPSHOT' } }