Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix publish jobs and ci_cd.json processing (#2804)

Koen98063aa473b6
diff --git a/.ci_cd/ci_cd.json b/.ci_cd/ci_cd.json
index 342d089d7..d77cdb304 100644
--- a/.ci_cd/ci_cd.json
+++ b/.ci_cd/ci_cd.json
@@ -3,7 +3,6 @@
"master": {
"distribute": {
"docker": "develop",
- "maven": "$version-SNAPSHOT",
"npm": "$version-snapshot"
},
"deploy": {
@@ -15,7 +14,6 @@
"release": {
"distribute": {
"docker": "latest,$version",
- "maven": "$version",
"npm": "$version"
},
"deploy": {
diff --git a/.github/actions/get-version-details/action.yml b/.github/actions/get-version-details/action.yml
index 3b9424a09..63e615092 100644
--- a/.github/actions/get-version-details/action.yml
+++ b/.github/actions/get-version-details/action.yml
@@ -34,6 +34,6 @@ runs:
if [ "$version" == "$versionWithQualifier" ]; then
isRelease=true
fi
- echo "version=$version" >> $GITHUB_OUTPUT
- echo "version_with_qualifier=$versionWithQualifier" >> $GITHUB_OUTPUT
- echo "is_release=$isRelease" >> $GITHUB_OUTPUT
+ echo "version=$version" | tee -a $GITHUB_OUTPUT
+ echo "version_with_qualifier=$versionWithQualifier" | tee -a $GITHUB_OUTPUT
+ echo "is_release=$isRelease" | tee -a $GITHUB_OUTPUT
diff --git a/.github/actions/process-cicd-json/action.yml b/.github/actions/process-cicd-json/action.yml
index 391c134f6..4f557acea 100644
--- a/.github/actions/process-cicd-json/action.yml
+++ b/.github/actions/process-cicd-json/action.yml
@@ -28,6 +28,12 @@ outputs:
runs:
using: composite
steps:
+ - name: Check ci_cd existence
+ id: check_cicd_json
+ uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
+ with:
+ files: ".ci_cd/ci_cd.json"
+
- name: Process ci_cd.json file
if: ${{ steps.check_cicd_json.outputs.files_exists == 'true' && (github.ref_type == 'tag' || (github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request')) }}
id: ci-cd-output
@@ -46,7 +52,6 @@ runs:
version = os.getenv('VERSION')
deploys = None
dockerPublishTags = None
- mavenPublishTag = None
npmPublishTag = None
deployEnvironment = None
eventConfig = ()
@@ -69,8 +74,6 @@ runs:
if 'distribute' in eventConfig:
if 'docker' in eventConfig['distribute']:
dockerPublishTags = eventConfig['distribute']['docker']
- if 'maven' in eventConfig['distribute']:
- mavenPublishTag = eventConfig['distribute']['maven']
if 'npm' in eventConfig['distribute']:
npmPublishTag = eventConfig['distribute']['npm']
@@ -85,19 +88,14 @@ runs:
firstDockerTag = dockerPublishTags.split(",")[0]
os.system(f"echo 'firstDockerTag={firstDockerTag}' >> $GITHUB_OUTPUT")
- os.system(f" echo 'Manager tags to push to docker hub: {dockerPublishTags}'")
- dockerPublishTags = " ".join(map(lambda t: f"-t openremote/manager:{t.strip()}", dockerPublishTags.split(",")))
+ print("Manager tags to push to docker hub: {dockerPublishTags}")
+ dockerPublishTags = " ".join(map(lambda t: t.strip(), dockerPublishTags.split(",")))
if repoOwner == 'openremote':
os.system(f"echo 'dockerTags={dockerPublishTags}' >> $GITHUB_OUTPUT")
- if mavenPublishTag is not None and repoOwner == 'openremote':
- mavenPublishTag = mavenPublishTag.replace("$version", version)
- os.system(f" echo 'Maven publish version: {mavenPublishTag}'")
- os.system(f"echo 'mavenTag={mavenPublishTag}' >> $GITHUB_OUTPUT")
-
if npmPublishTag is not None and repoOwner == 'openremote':
npmPublishTag = npmPublishTag.replace("$version", version)
- os.system(f" echo 'npm publish version: {npmPublishTag}'")
+ print(f"npm publish version: {npmPublishTag}")
os.system(f"echo 'npmTag={npmPublishTag}' >> $GITHUB_OUTPUT")
deployStr = None
diff --git a/.github/workflows/build-manager-image.yml b/.github/workflows/build-manager-image.yml
index 053e57389..f547d1e4d 100644
--- a/.github/workflows/build-manager-image.yml
+++ b/.github/workflows/build-manager-image.yml
@@ -76,7 +76,7 @@ jobs:
platforms: linux/amd64 # "ubuntu-latest" runs on x86 GitHub runners
load: true # Load image locally for Grype Scan
push: false
- tags: ${{ steps.parse-tags.outputs.formatted_tags }}
+ tags: ${{ steps.meta.outputs.formatted_tags }}
build-args: |
GIT_COMMIT=${{ github.sha }}
cache-from: type=gha,scope=manager
@@ -117,7 +117,7 @@ jobs:
platforms: linux/amd64,linux/aarch64
load: false
push: ${{ steps.meta.outputs.should_push == 'true' }}
- tags: ${{ steps.parse-tags.outputs.formatted_tags }}
+ tags: ${{ steps.meta.outputs.formatted_tags }}
build-args: |
GIT_COMMIT=${{ github.sha }}
cache-from: type=gha,scope=manager
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 53aed6955..488a6f679 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -41,7 +41,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check if main repo
id: is_main_repo
- uses: openremote/openremote/.github/actions/check-if-main-repo@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/check-if-main-repo@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
install-dist:
name: Build
diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml
index 362511650..306218ef3 100644
--- a/.github/workflows/deployment.yml
+++ b/.github/workflows/deployment.yml
@@ -16,17 +16,11 @@ jobs:
- name: Get version details
id: get-version-details
- uses: openremote/openremote/.github/actions/get-version-details@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
-
- - name: Check ci_cd existence
- id: check_cicd_json
- uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
- with:
- files: ".ci_cd/ci_cd.json"
+ uses: openremote/openremote/.github/actions/get-version-details@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
- name: Check if main repo
id: is_main_repo
- uses: openremote/openremote/.github/actions/check-if-main-repo@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/check-if-main-repo@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
- name: Checkout main repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -41,9 +35,8 @@ jobs:
sparse-checkout-cone-mode: false
- name: Process ci_cd.json file
- if: ${{ steps.check_cicd_json.outputs.files_exists == 'true' && (github.ref_type == 'tag' || (github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request')) }}
id: ci-cd-output
- uses: openremote/openremote/.github/actions/process-cicd-json@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/process-cicd-json@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
with:
IS_MAIN_REPO: ${{ steps.is_main_repo.outputs.value }}
MANAGER_VERSION: ${{ steps.is_main_repo.outputs.version }}
diff --git a/.github/workflows/install-dist.yml b/.github/workflows/install-dist.yml
index 562a205e9..aa5083e3a 100644
--- a/.github/workflows/install-dist.yml
+++ b/.github/workflows/install-dist.yml
@@ -28,7 +28,7 @@ jobs:
- name: Check if main repo
id: is_main_repo
- uses: openremote/openremote/.github/actions/check-if-main-repo@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/check-if-main-repo@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
- name: Set up JDK 21 and Gradle cache
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
diff --git a/.github/workflows/publish-maven.yml b/.github/workflows/publish-maven.yml
index 6adfb103d..7ccf456f3 100644
--- a/.github/workflows/publish-maven.yml
+++ b/.github/workflows/publish-maven.yml
@@ -1,10 +1,6 @@
name: Maven
on:
workflow_call:
- inputs:
- MAVEN_TAG:
- type: string
- required: true
secrets:
MAVEN_SIGNING_PASSWORD:
required: true
@@ -19,11 +15,32 @@ jobs:
maven-publish:
name: Publish to Maven Central Sonatype
runs-on: ubuntu-latest
- env:
- MAVEN_TAG: ${{ inputs.MAVEN_TAG }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Set up JDK 21 and Gradle cache
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
+ with:
+ distribution: "temurin"
+ java-version: "21"
+ cache: "gradle"
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: or-manager-build
+ path: manager/build
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: or-ui-component-build
+ path: ui/component
+
- name: Publish to Maven Central Sonatype
- run: ./gradlew publishToSonatype --no-parallel -PsigningKey=${{ secrets.MAVEN_SIGNING_KEY }} -PsigningPassword=${{ secrets.MAVEN_SIGNING_PASSWORD }} -PpublishUsername=${{ secrets.MAVEN_USERNAME }} -PpublishPassword=${{ secrets.MAVEN_PASSWORD }}"
+ run: ./gradlew publishToSonatype --no-parallel -PsigningKey=${{ secrets.MAVEN_SIGNING_KEY }} -PsigningPassword=${{ secrets.MAVEN_SIGNING_PASSWORD }} -PpublishUsername=${{ secrets.MAVEN_USERNAME }} -PpublishPassword=${{ secrets.MAVEN_PASSWORD }}
+
+ - name: Close and Verify Staging Repository
+ # This will poll the Sonatype API and wait until all validation rules pass.
+ run: ./gradlew findSonatypeStagingRepository closeSonatypeStagingRepository -PpublishUsername=${{ secrets.MAVEN_USERNAME }} -PpublishPassword=${{ secrets.MAVEN_PASSWORD }}
+
- name: Release to Maven Central Sonatype
- run: ./gradlew findSonatypeStagingRepository closeAndReleaseSonatypeStagingRepository -PpublishUsername=${{ secrets.MAVEN_USERNAME }} -PpublishPassword=${{ secrets.MAVEN_PASSWORD }}
+ run: ./gradlew findSonatypeStagingRepository releaseSonatypeStagingRepository -PpublishUsername=${{ secrets.MAVEN_USERNAME }} -PpublishPassword=${{ secrets.MAVEN_PASSWORD }}
diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml
index f5ab2dc7e..b81575c62 100644
--- a/.github/workflows/publish-npm.yml
+++ b/.github/workflows/publish-npm.yml
@@ -25,7 +25,6 @@ jobs:
- name: Publish to NPM
run: |
echo 'npmRegistries:' >> .yarnrc.yml
- echo '"https://registry.yarnpkg.com":' >> .yarnrc.yml
- echo "npmAuthToken: ${{ secrets.NPM_AUTH_TOKEN }}" >> .yarnrc.yml
-
+ echo ' "https://registry.yarnpkg.com":' >> .yarnrc.yml
+ echo " npmAuthToken: ${{ secrets.NPM_AUTH_TOKEN }}" >> .yarnrc.yml
yarn workspaces foreach --all --no-private --topological npm publish --tag ${{ inputs.tag }}
diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml
index 9078362cf..720eccd33 100644
--- a/.github/workflows/review.yml
+++ b/.github/workflows/review.yml
@@ -142,4 +142,4 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get version details
id: get-version-details
- uses: openremote/openremote/.github/actions/get-version-details@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/get-version-details@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index afeda9383..09690fb41 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -41,7 +41,6 @@ jobs:
is_release: ${{ steps.get-version-details.outputs.is_release }}
# Processed ci_cd.json outputs
dockerTags: ${{ steps.ci-cd-output.outputs.dockerTags }}
- mavenTag: ${{ steps.ci-cd-output.outputs.mavenTag }}
npmTag: ${{ steps.ci-cd-output.outputs.npmTag }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -67,22 +66,15 @@ jobs:
- name: Get version details
id: get-version-details
- uses: openremote/openremote/.github/actions/get-version-details@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
-
- - name: Check ci_cd existence
- id: check_cicd_json
- uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
- with:
- files: ".ci_cd/ci_cd.json"
+ uses: openremote/openremote/.github/actions/get-version-details@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
- name: Check if main repo
id: is_main_repo
- uses: openremote/openremote/.github/actions/check-if-main-repo@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/check-if-main-repo@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
- name: Process ci_cd.json file
- if: ${{ steps.check_cicd_json.outputs.files_exists == 'true' && (github.ref_type == 'tag' || (github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request')) }}
id: ci-cd-output
- uses: openremote/openremote/.github/actions/process-cicd-json@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/process-cicd-json@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
with:
IS_MAIN_REPO: ${{ steps.is_main_repo.outputs.value }} # Shouldn't be needed in this context
MANAGER_VERSION: ${{ steps.is_main_repo.outputs.version }}
@@ -169,8 +161,6 @@ jobs:
always() &&
!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: "./.github/workflows/publish-maven.yml"
- with:
- MAVEN_TAG: ${{ needs.detect-changes.outputs.mavenTag }}
secrets:
MAVEN_SIGNING_PASSWORD: ${{ secrets._TEMP_MAVEN_SIGNING_PASSWORD }}
MAVEN_SIGNING_KEY: ${{ secrets._TEMP_MAVEN_SIGNING_KEY }}
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index b6bb08fff..8dcd6603c 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -24,7 +24,7 @@ jobs:
- name: Check if main repo
id: is_main_repo
- uses: openremote/openremote/.github/actions/check-if-main-repo@9bf40702cf69c4b3de5f719f4c14b1240d9762d3
+ uses: openremote/openremote/.github/actions/check-if-main-repo@fa6f52032b1dea3d4ad080cc6436a3ef3843b0be
- name: Run unit tests
timeout-minutes: 20