diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/manual-docker-publish.yaml similarity index 96% rename from .github/workflows/publish-docker.yaml rename to .github/workflows/manual-docker-publish.yaml index bf5ac3b01..a8fcf4c7b 100644 --- a/.github/workflows/publish-docker.yaml +++ b/.github/workflows/manual-docker-publish.yaml @@ -20,7 +20,7 @@ --- -name: "Create Docker images" +name: "Create and publish Docker images" on: workflow_dispatch: @@ -40,7 +40,7 @@ concurrency: jobs: create-docker-image: - name: "Create Docker Images for the ControlPlane" + name: "Build and push images" runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/publish-maven.yaml b/.github/workflows/manual-maven-publish.yaml similarity index 69% rename from .github/workflows/publish-maven.yaml rename to .github/workflows/manual-maven-publish.yaml index e30663c3e..bbdf02063 100644 --- a/.github/workflows/publish-maven.yaml +++ b/.github/workflows/manual-maven-publish.yaml @@ -20,14 +20,14 @@ --- -name: "Manually publish Maven Artefacts to OSSRH" +name: "Publish Maven Artefacts to OSSRH" on: workflow_dispatch: inputs: version: required: false - description: 'a semver string denoting the version. Append -SNAPSHOT for snapshots. If ommitted, the version is taken from gradle.properties' + description: 'a semver string denoting the version. Append -SNAPSHOT for snapshots. If omitted, the version is taken from gradle.properties' concurrency: # cancel only running jobs on pull requests @@ -58,12 +58,25 @@ jobs: OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }} run: |- - if [ -z ${{ inputs.version }} ]; - then + + # check if version input was specified, else read from gradle.properties + + if [ ! -z ${{ inputs.version }} ]; + then + VERSION=${{ inputs.version }} + echo "Publishing using version from parameter: $VERSION" + else VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}') echo "Publishing using version from gradle.properties: $VERSION" - ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Pversion=$VERSION -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}" - else - echo "Publishing using version from parameter: ${{ inputs.version }}" - ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Pversion=${{ inputs.version }} -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}" fi + + # check if the version is a SNAPSHOT, and if not, append command to close staging repo + + cmd="" + if [[ $VERSION != *-SNAPSHOT ]] + then + cmd="closeAndReleaseSonatypeStagingRepository"; + fi + echo "Publishing Version $VERSION to Sonatype" + + ./gradlew publishToSonatype ${cmd} --no-parallel -Pversion=$VERSION -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}"