From 00084d9122c2342e9fe34ead68c3fc39b44f42ea Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 13 Feb 2025 10:01:01 +0100 Subject: [PATCH 1/6] IONOS(build): rename hidrive_next_build_zip to hidrive_next_build_artifact in case we switch to tar.gz Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 2db0bab8b92b9..facf5e0a812bc 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -121,7 +121,7 @@ jobs: - name: Upload artifact result for job hidrive-next-build uses: actions/upload-artifact@v4 with: - name: hidrive_next_build_zip + name: hidrive_next_build_artifact path: ${{ env.TARGET_PACKAGE_NAME }} - name: Show changes on failure @@ -145,7 +145,7 @@ jobs: - name: Download artifact zip uses: actions/download-artifact@v4 with: - name: hidrive_next_build_zip + name: hidrive_next_build_artifact - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 From 60e51207af479c0550a3e850a14082e75adaa315 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 13 Feb 2025 13:21:23 +0100 Subject: [PATCH 2/6] IONOS(build): save build artifacts only for 30 days in order not go over gitlab quota. since we use it just to pass from job to job. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index facf5e0a812bc..73fa7ba9134bd 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -121,6 +121,7 @@ jobs: - name: Upload artifact result for job hidrive-next-build uses: actions/upload-artifact@v4 with: + retention-days: 30 name: hidrive_next_build_artifact path: ${{ env.TARGET_PACKAGE_NAME }} From d00216c8ac8fbee4bf5294d9cd50ad5d918c0423 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 18 Feb 2025 15:08:25 +0100 Subject: [PATCH 3/6] IONOS(build): remove unused permissions Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 73fa7ba9134bd..7ea341d7243b6 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -48,7 +48,6 @@ jobs: permissions: contents: read - packages: write name: hidrive-next-build steps: From 487c5ca72f8936198446af43636d74671f079e3b Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 13 Feb 2025 14:27:49 +0100 Subject: [PATCH 4/6] IONOS(build): remove build on non-hidrivenext branches main, master, stable* are non-hidrivenext branches Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 7ea341d7243b6..378d9dfeb73cc 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -28,11 +28,7 @@ on: - '**.vue' push: branches: - - main - - master - - stable* - ionos-dev - - ionos-dev30 env: TARGET_PACKAGE_NAME: hidrive-next.zip From 10db341ab4aee4fef42ccf2f7ca2d830f2d3ebd5 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 12 Feb 2025 17:13:48 +0100 Subject: [PATCH 5/6] IONOS(build): upload dev artifact to artifactory on PR push Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 76 ++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 378d9dfeb73cc..3e84d38c54d87 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -34,6 +34,7 @@ env: TARGET_PACKAGE_NAME: hidrive-next.zip REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} + ARTIFACTORY_REPOSITORY_SNAPSHOT: ionos-productivity-hdnext-snapshot permissions: contents: read @@ -45,6 +46,9 @@ jobs: permissions: contents: read + outputs: + NC_VERSION: ${{ steps.get_nc_version.outputs.NC_VERSION }} + name: hidrive-next-build steps: - name: Checkout server @@ -113,6 +117,19 @@ jobs: - name: Zip dependencies run: make -f IONOS/Makefile zip_dependencies TARGET_PACKAGE_NAME=${{ env.TARGET_PACKAGE_NAME }} + - name: Get NC version + id: get_nc_version + run: | + NC_VERSION=$(jq -r '.ncVersion' version.json) + echo "NC_VERSION: $NC_VERSION" + + if [ -z "$NC_VERSION" ]; then + echo "NC_VERSION is empty" + exit 1 + fi + + echo "NC_VERSION=$NC_VERSION" >> $GITHUB_OUTPUT + - name: Upload artifact result for job hidrive-next-build uses: actions/upload-artifact@v4 with: @@ -127,6 +144,65 @@ jobs: git --no-pager diff exit 1 # make it red to grab attention + upload-to-artifactory: + runs-on: self-hosted + # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev" branch push defined in the on:push:branches + if: github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' + + name: Push artifact to artifactory as dev build + needs: hidrive-next-build + + env: + BUILD_NAME: "hidrive_next-snapshot" + + steps: + - name: Download artifact zip + uses: actions/download-artifact@v4 + with: + name: hidrive_next_build_artifact + + # This action sets up the JFrog CLI with the Artifactory URL and access token + - uses: jfrog/setup-jfrog-cli@v4 + env: + JF_URL: ${{ secrets.JF_ARTIFACTORY_URL }} + JF_USER: ${{ secrets.JF_ARTIFACTORY_USER }} + JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} + + - name: Ping the JF server + run: | + # Ping the server + jf rt ping + + - name: Upload build to artifactory + run: | + # PR builds are stored in a separate directory as "dev/pr/hidrive-next-pr-.zip" + # Push to "ionos-dev" branch is stored as "dev/hidrive-next-.zip" + + ARTIFACTORY_STAGE_PREFIX="dev" + + export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}" + PATH_TO_FILE="pr/hidrive-next-pr-${{ github.event.pull_request.number }}.zip" + + if [ -z "${{ github.event.pull_request.number }}" ]; then + PATH_TO_FILE="hidrive-next-${{ needs.hidrive-next-build.outputs.NC_VERSION }}.zip" + fi + + export PATH_TO_LATEST_ARTIFACT="${PATH_TO_DIRECTORY}/${PATH_TO_FILE}" + + # Promote current build to the "latest" dev build + jf rt upload "${{ env.TARGET_PACKAGE_NAME }}" \ + --build-name "${{ env.BUILD_NAME }}" \ + --build-number ${{ github.run_number }} \ + --target-props "hdnext.nc_version=${{ needs.hidrive-next-build.outputs.NC_VERSION }};vcs.branch=${{ github.ref }};vcs.revision=${{ github.sha }}" \ + $PATH_TO_LATEST_ARTIFACT + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention + hidirve-next-artifact-to-ghcr_io: runs-on: ubuntu-latest From 07612b002da8836a30eb734c16a1bd7add8fdfe5 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 17 Feb 2025 15:05:34 +0100 Subject: [PATCH 6/6] IONOS(build): upload dev artifact to artifactory on ionos-stable push artifact will be saved under ionos-productivity-hdnext-snapshot/stable folder Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 3e84d38c54d87..207972ef05527 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -29,6 +29,7 @@ on: push: branches: - ionos-dev + - ionos-stable env: TARGET_PACKAGE_NAME: hidrive-next.zip @@ -146,8 +147,8 @@ jobs: upload-to-artifactory: runs-on: self-hosted - # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev" branch push defined in the on:push:branches - if: github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' + # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable" branch push defined in the on:push:branches + if: github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' name: Push artifact to artifactory as dev build needs: hidrive-next-build @@ -180,6 +181,11 @@ jobs: ARTIFACTORY_STAGE_PREFIX="dev" + # set ARTIFACTORY_STAGE_PREFIX=stable on ionos-stable branch + if [ "${{ github.ref_name }}" == "ionos-stable" ]; then + ARTIFACTORY_STAGE_PREFIX="stable" + fi + export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}" PATH_TO_FILE="pr/hidrive-next-pr-${{ github.event.pull_request.number }}.zip"