From d6b61eb6148f473f6303954d45be7c90233cfae5 Mon Sep 17 00:00:00 2001 From: MK Software Date: Fri, 17 Jan 2025 15:09:24 +0100 Subject: [PATCH 01/21] publising on staging should not require passing tests jobs --- .github/workflows/pr.yml | 102 +++++---------------------- .github/workflows/shared/publish.yml | 96 +++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/shared/publish.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index aef699634d2..eb22c4e2694 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -69,6 +69,7 @@ jobs: echo "scala_version_matrix=[\"2.13\"]" >> $GITHUB_OUTPUT fi + build: name: Build runs-on: ubuntu-latest @@ -521,93 +522,26 @@ jobs: script: | core.setFailed('Snapshots updated, chceck comments!') - #TODO: extract to different workflow? - publish: - runs-on: ubuntu-latest - needs: [build, build-fe, setup, tests, integrationTests, slowTests, frontendTests, cypressTests] - #TODO: should we publish everything on all those branches? - if: ${{ github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/demo' || startsWith(github.ref, 'refs/heads/preview') || startsWith(github.ref, 'refs/heads/release') }} - env: - #TODO: shouldn't be needed... - nexusUrl: https://oss.sonatype.org/content/repositories/snapshots - # We add dev model to staging because it is used in dev used on this environment, but we also add it for other branches for purpose of cypress tests - addDevArtifacts: true - NUSSKNACKER_VERSION: ${{ needs.setup.outputs.nk_snapshot_version }} - GIT_SOURCE_BRANCH: ${{ needs.setup.outputs.git_source_branch }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USER }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - steps: - - name: Cancel previous runs - if: github.event_name != 'push' - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v3 - - uses: coursier/setup-action@v1 - with: - jvm: temurin:1.11.0.17 - - name: Cache ivy packages - uses: actions/cache@v3 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: sbt-cache-${{ hashFiles('**/*.sbt') }} - restore-keys: sbt - - uses: actions/download-artifact@v4 - with: - name: build-target - - name: Untar artifacts - shell: bash - run: tar xfz target.tgz - - uses: actions/download-artifact@v4 - with: - name: build-fe-dist - - name: Untar fe artifacts - shell: bash - run: tar xfz fe-dist.tgz - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Setup buildx builder - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64,linux/arm64 - config-inline: | - [worker.oci] - max-parallelism = 1 - - name: Try to free space - run: | - # Workaround to prevent "no space left on device" during buildx build - https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo rm -rf /usr/local/lib/android - - uses: sbt/setup-sbt@v1 - - name: Publish with scaladocs - if: ${{ github.ref == 'refs/heads/staging' }} - env: - # Workaround to preveent "no space left on device" during publishDocker failed to create temp dir: mkdir /tmp/containerd-mountXYZ - TMPDIR: ${{ github.workspace }} - shell: bash - #TODO: handle version better, do we want to publish docker image for older scala versions? If so, how should it be tagged? - run: sbt "set ThisBuild / version := \"$NUSSKNACKER_VERSION\"" +publish +dist/Docker/publish +liteEngineRuntimeApp/Docker/publish - - name: Publish without scaladocs - if: ${{ github.ref != 'refs/heads/staging' }} - env: - # Workaround to preveent "no space left on device" during publishDocker failed to create temp dir: mkdir /tmp/containerd-mountXYZ - TMPDIR: ${{ github.workspace }} - shell: bash - #TODO: handle version better, do we want to publish docker image for older scala versions? If so, how should it be tagged? - run: sbt "set ThisBuild / version := \"$NUSSKNACKER_VERSION\"; set ThisBuild / packageDoc / publishArtifact := false; set Compile / doc / sources := Seq.empty" +publish +dist/Docker/publish +liteEngineRuntimeApp/Docker/publish + + publish-after-tests: + name: Publish With Tests + uses: ./.github/workflows/shared/publish.yml + needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] + with: + ref: ${{ github.ref }} + if: ${{ github.ref != 'refs/heads/staging' }} + + publish-before-tests: + name: Publish Without Tests + uses: ./.github/workflows/shared/publish.yml + needs: ['build', 'build-fe', 'setup'] + with: + ref: ${{ github.ref }} + if: ${{ github.ref == 'refs/heads/staging' }} trigger-external-build: runs-on: ubuntu-latest - needs: [ setup, publish ] + needs: [ setup, publish-before-tests ] if: ${{ github.ref == 'refs/heads/staging' }} strategy: matrix: diff --git a/.github/workflows/shared/publish.yml b/.github/workflows/shared/publish.yml new file mode 100644 index 00000000000..71d4fd6a661 --- /dev/null +++ b/.github/workflows/shared/publish.yml @@ -0,0 +1,96 @@ +name: Publish +on: + workflow_call: + inputs: + ref: + description: "The branch or tag being published" + required: true + type: string + secrets: + SONATYPE_USER: + required: true + SONATYPE_PASSWORD: + required: true + DOCKERHUB_USER: + required: true + DOCKERHUB_TOKEN: + required: true + +jobs: + publish: + runs-on: ubuntu-latest + if: ${{ inputs.ref == 'refs/heads/staging' || inputs.ref == 'refs/heads/master' || inputs.ref == 'refs/heads/demo' || startsWith(inputs.ref, 'refs/heads/preview') || startsWith(inputs.ref, 'refs/heads/release') }} + env: + nexusUrl: https://oss.sonatype.org/content/repositories/snapshots + addDevArtifacts: true + NUSSKNACKER_VERSION: ${{ needs.setup.outputs.nk_snapshot_version }} + GIT_SOURCE_BRANCH: ${{ needs.setup.outputs.git_source_branch }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USER }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + steps: + - name: Cancel previous runs + if: github.event_name != 'push' + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + - uses: coursier/setup-action@v1 + with: + jvm: temurin:1.11.0.17 + - name: Cache ivy packages + uses: actions/cache@v3 + with: + path: | + ~/.ivy2/cache + ~/.cache/coursier + ~/.sbt + key: sbt-cache-${{ hashFiles('**/*.sbt') }} + restore-keys: sbt + - uses: actions/download-artifact@v4 + with: + name: build-target + - name: Untar artifacts + shell: bash + run: tar xfz target.tgz + - uses: actions/download-artifact@v4 + with: + name: build-fe-dist + - name: Untar fe artifacts + shell: bash + run: tar xfz fe-dist.tgz + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup buildx builder + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64,linux/arm64 + config-inline: | + [worker.oci] + max-parallelism = 1 + - name: Try to free space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + sudo rm -rf /usr/local/lib/android + - uses: sbt/setup-sbt@v1 + - name: Publish with scaladocs + if: ${{ inputs.ref == 'refs/heads/staging' }} + env: + # Workaround to preveent "no space left on device" during publishDocker failed to create temp dir: mkdir /tmp/containerd-mountXYZ + TMPDIR: ${{ github.workspace }} + shell: bash + #TODO: handle version better, do we want to publish docker image for older scala versions? If so, how should it be tagged? + run: sbt "set ThisBuild / version := \"$NUSSKNACKER_VERSION\"" +publish +dist/Docker/publish +liteEngineRuntimeApp/Docker/publish + - name: Publish without scaladocs + if: ${{ inputs.ref != 'refs/heads/staging' }} + env: + # Workaround to preveent "no space left on device" during publishDocker failed to create temp dir: mkdir /tmp/containerd-mountXYZ + TMPDIR: ${{ github.workspace }} + shell: bash + #TODO: handle version better, do we want to publish docker image for older scala versions? If so, how should it be tagged? + run: sbt "set ThisBuild / version := \"$NUSSKNACKER_VERSION\"; set ThisBuild / packageDoc / publishArtifact := false; set Compile / doc / sources := Seq.empty" +publish +dist/Docker/publish +liteEngineRuntimeApp/Docker/publish From daebdb345e830fea9c451dc1151f7defdd28af3a Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:05:54 +0100 Subject: [PATCH 02/21] fix --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index eb22c4e2694..c861dde1bdd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -525,7 +525,7 @@ jobs: publish-after-tests: name: Publish With Tests - uses: ./.github/workflows/shared/publish.yml + uses: .github/workflows/shared/publish.yml needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] with: ref: ${{ github.ref }} @@ -533,7 +533,7 @@ jobs: publish-before-tests: name: Publish Without Tests - uses: ./.github/workflows/shared/publish.yml + uses: .github/workflows/shared/publish.yml needs: ['build', 'build-fe', 'setup'] with: ref: ${{ github.ref }} From 5630eafbb03d86c1d056091171a3368b7a224f0f Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:11:33 +0100 Subject: [PATCH 03/21] fix --- .../shared/publish.yml => actions/publish/action.yml} | 0 .github/workflows/pr.yml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/{workflows/shared/publish.yml => actions/publish/action.yml} (100%) diff --git a/.github/workflows/shared/publish.yml b/.github/actions/publish/action.yml similarity index 100% rename from .github/workflows/shared/publish.yml rename to .github/actions/publish/action.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c861dde1bdd..5ef081fc30d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -525,7 +525,7 @@ jobs: publish-after-tests: name: Publish With Tests - uses: .github/workflows/shared/publish.yml + uses: ./.github/actions/publish needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] with: ref: ${{ github.ref }} @@ -533,7 +533,7 @@ jobs: publish-before-tests: name: Publish Without Tests - uses: .github/workflows/shared/publish.yml + uses: ./.github/actions/publish needs: ['build', 'build-fe', 'setup'] with: ref: ${{ github.ref }} From dee0917f33c36bdc30bc14e6b6516005a5ea9591 Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:18:08 +0100 Subject: [PATCH 04/21] fix --- .github/workflows/pr.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5ef081fc30d..100ed3f7804 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -525,19 +525,25 @@ jobs: publish-after-tests: name: Publish With Tests - uses: ./.github/actions/publish needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] with: ref: ${{ github.ref }} if: ${{ github.ref != 'refs/heads/staging' }} + steps: + - uses: actions/checkout@v1 + - name: Use local publish + uses: ./.github/actions/publish publish-before-tests: name: Publish Without Tests - uses: ./.github/actions/publish needs: ['build', 'build-fe', 'setup'] with: ref: ${{ github.ref }} if: ${{ github.ref == 'refs/heads/staging' }} + steps: + - uses: actions/checkout@v1 + - name: Use local publish + uses: ./.github/actions/publish trigger-external-build: runs-on: ubuntu-latest From 0f8c52356174ae1f097331cac7f84fe6ce866045 Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:19:41 +0100 Subject: [PATCH 05/21] fix --- .github/workflows/pr.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 100ed3f7804..fd49795f569 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -531,8 +531,7 @@ jobs: if: ${{ github.ref != 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - - name: Use local publish - uses: ./.github/actions/publish + - uses: ./.github/actions/publish publish-before-tests: name: Publish Without Tests @@ -542,8 +541,7 @@ jobs: if: ${{ github.ref == 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - - name: Use local publish - uses: ./.github/actions/publish + - uses: ./.github/actions/publish trigger-external-build: runs-on: ubuntu-latest From 23e422e53d3e28be9ab9c4786f8ddc9059e623de Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:20:18 +0100 Subject: [PATCH 06/21] fix --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fd49795f569..c8c252e9a22 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -531,7 +531,7 @@ jobs: if: ${{ github.ref != 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - - uses: ./.github/actions/publish + - uses: ./.github/actions/publish/action.yml publish-before-tests: name: Publish Without Tests @@ -541,7 +541,7 @@ jobs: if: ${{ github.ref == 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - - uses: ./.github/actions/publish + - uses: ./.github/actions/publish/action.yml trigger-external-build: runs-on: ubuntu-latest From ea3d102379d2d1e7b642a74bfb1e991f692d2db0 Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:21:54 +0100 Subject: [PATCH 07/21] another try --- .github/workflows/pr.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c8c252e9a22..3d53dbc3806 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -523,6 +523,7 @@ jobs: core.setFailed('Snapshots updated, chceck comments!') + publish-after-tests: name: Publish With Tests needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] @@ -531,7 +532,8 @@ jobs: if: ${{ github.ref != 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - - uses: ./.github/actions/publish/action.yml + - name: "publish" + uses: ./.github/actions/publish/action.yml publish-before-tests: name: Publish Without Tests @@ -541,7 +543,8 @@ jobs: if: ${{ github.ref == 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - - uses: ./.github/actions/publish/action.yml + - name: "publish" + uses: ./.github/actions/publish/action.yml trigger-external-build: runs-on: ubuntu-latest From 17d36e87291d59f67989a1c16f8549475d408652 Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:24:15 +0100 Subject: [PATCH 08/21] another try --- .github/workflows/pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3d53dbc3806..ece1ba27702 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -527,24 +527,24 @@ jobs: publish-after-tests: name: Publish With Tests needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] - with: - ref: ${{ github.ref }} if: ${{ github.ref != 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - name: "publish" uses: ./.github/actions/publish/action.yml + with: + ref: ${{ github.ref }} publish-before-tests: name: Publish Without Tests needs: ['build', 'build-fe', 'setup'] - with: - ref: ${{ github.ref }} if: ${{ github.ref == 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - name: "publish" uses: ./.github/actions/publish/action.yml + with: + ref: ${{ github.ref }} trigger-external-build: runs-on: ubuntu-latest From 6a721b32764cf352d20e43199cc68725b54e8dd5 Mon Sep 17 00:00:00 2001 From: MK Software Date: Tue, 21 Jan 2025 21:26:14 +0100 Subject: [PATCH 09/21] another try --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ece1ba27702..e187db82a1a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -526,6 +526,7 @@ jobs: publish-after-tests: name: Publish With Tests + runs-on: ubuntu-latest needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] if: ${{ github.ref != 'refs/heads/staging' }} steps: @@ -537,6 +538,7 @@ jobs: publish-before-tests: name: Publish Without Tests + runs-on: ubuntu-latest needs: ['build', 'build-fe', 'setup'] if: ${{ github.ref == 'refs/heads/staging' }} steps: From e22e56e7de73f192ecc45832679f66f24bbf8a35 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 09:36:14 +0100 Subject: [PATCH 10/21] another try --- .github/workflows/pr.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e187db82a1a..05c40072811 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -522,8 +522,6 @@ jobs: script: | core.setFailed('Snapshots updated, chceck comments!') - - publish-after-tests: name: Publish With Tests runs-on: ubuntu-latest @@ -532,7 +530,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: "publish" - uses: ./.github/actions/publish/action.yml + uses: ./.github/actions/publish with: ref: ${{ github.ref }} @@ -540,11 +538,11 @@ jobs: name: Publish Without Tests runs-on: ubuntu-latest needs: ['build', 'build-fe', 'setup'] - if: ${{ github.ref == 'refs/heads/staging' }} + #if: ${{ github.ref == 'refs/heads/staging' }} steps: - uses: actions/checkout@v1 - name: "publish" - uses: ./.github/actions/publish/action.yml + uses: ./.github/actions/publish with: ref: ${{ github.ref }} From 0d647d8fe50b46d1d69bda0b3c6a6c876ecf4005 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 10:59:45 +0100 Subject: [PATCH 11/21] another try --- .github/workflows/pr.yml | 28 +++++++++++-------- .../action.yml => workflows/publish.yml} | 0 2 files changed, 16 insertions(+), 12 deletions(-) rename .github/{actions/publish/action.yml => workflows/publish.yml} (100%) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 05c40072811..c9c53e4b8a3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -527,24 +527,28 @@ jobs: runs-on: ubuntu-latest needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] if: ${{ github.ref != 'refs/heads/staging' }} - steps: - - uses: actions/checkout@v1 - - name: "publish" - uses: ./.github/actions/publish - with: - ref: ${{ github.ref }} + uses: + uses: ./.github/workflows/publish.yml +# steps: +# - uses: actions/checkout@v1 +# - name: "publish" +# uses: ./.github/actions/publish +# with: +# ref: ${{ github.ref }} publish-before-tests: name: Publish Without Tests runs-on: ubuntu-latest needs: ['build', 'build-fe', 'setup'] #if: ${{ github.ref == 'refs/heads/staging' }} - steps: - - uses: actions/checkout@v1 - - name: "publish" - uses: ./.github/actions/publish - with: - ref: ${{ github.ref }} + uses: + uses: ./.github/workflows/publish.ymls +# steps: +# - uses: actions/checkout@v1 +# - name: "publish" +# uses: ./.github/actions/publish +# with: +# ref: ${{ github.ref }} trigger-external-build: runs-on: ubuntu-latest diff --git a/.github/actions/publish/action.yml b/.github/workflows/publish.yml similarity index 100% rename from .github/actions/publish/action.yml rename to .github/workflows/publish.yml From 45bb51ea41c5767ae608174dbb1b1c226e55118c Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 11:00:23 +0100 Subject: [PATCH 12/21] another try --- .github/workflows/pr.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c9c53e4b8a3..9ecee32aafd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -529,12 +529,13 @@ jobs: if: ${{ github.ref != 'refs/heads/staging' }} uses: uses: ./.github/workflows/publish.yml + with: + ref: ${{ github.ref }} # steps: # - uses: actions/checkout@v1 # - name: "publish" # uses: ./.github/actions/publish -# with: -# ref: ${{ github.ref }} + publish-before-tests: name: Publish Without Tests From 9b19ad1bc5951e07c58190167153de4aa9a369e5 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 11:01:14 +0100 Subject: [PATCH 13/21] another try --- .github/workflows/pr.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9ecee32aafd..91e705799b1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -527,10 +527,9 @@ jobs: runs-on: ubuntu-latest needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] if: ${{ github.ref != 'refs/heads/staging' }} - uses: - uses: ./.github/workflows/publish.yml - with: - ref: ${{ github.ref }} + uses: ./.github/workflows/publish.yml + with: + ref: ${{ github.ref }} # steps: # - uses: actions/checkout@v1 # - name: "publish" @@ -542,8 +541,9 @@ jobs: runs-on: ubuntu-latest needs: ['build', 'build-fe', 'setup'] #if: ${{ github.ref == 'refs/heads/staging' }} - uses: - uses: ./.github/workflows/publish.ymls + uses: ./.github/workflows/publish.yml + with: + ref: ${{ github.ref }} # steps: # - uses: actions/checkout@v1 # - name: "publish" From dfa9a9f1bc678857aa9de0955d060ca9f62d9764 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 11:02:02 +0100 Subject: [PATCH 14/21] another try --- .github/workflows/pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 91e705799b1..ed3befcf693 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -528,8 +528,8 @@ jobs: needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] if: ${{ github.ref != 'refs/heads/staging' }} uses: ./.github/workflows/publish.yml - with: - ref: ${{ github.ref }} +# with: +# ref: ${{ github.ref }} # steps: # - uses: actions/checkout@v1 # - name: "publish" @@ -542,8 +542,8 @@ jobs: needs: ['build', 'build-fe', 'setup'] #if: ${{ github.ref == 'refs/heads/staging' }} uses: ./.github/workflows/publish.yml - with: - ref: ${{ github.ref }} +# with: +# ref: ${{ github.ref }} # steps: # - uses: actions/checkout@v1 # - name: "publish" From bd9b7434bd608adbe3d0f1e338d9a4f5ce6a7c19 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 11:03:54 +0100 Subject: [PATCH 15/21] another try --- .github/workflows/pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ed3befcf693..b7cb03c67c5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -537,9 +537,9 @@ jobs: publish-before-tests: - name: Publish Without Tests - runs-on: ubuntu-latest - needs: ['build', 'build-fe', 'setup'] +# name: Publish Without Tests +# runs-on: ubuntu-latest +# needs: ['build', 'build-fe', 'setup'] #if: ${{ github.ref == 'refs/heads/staging' }} uses: ./.github/workflows/publish.yml # with: From 7ac380370364724f47db81afb758984c9772b9da Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 11:32:00 +0100 Subject: [PATCH 16/21] another try --- .github/workflows/pr.yml | 19 +++++++++++++------ .github/workflows/publish.yml | 11 ++++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b7cb03c67c5..f4dcf9a8df3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -524,10 +524,14 @@ jobs: publish-after-tests: name: Publish With Tests - runs-on: ubuntu-latest - needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] - if: ${{ github.ref != 'refs/heads/staging' }} uses: ./.github/workflows/publish.yml + with: + should_run: true + job_needs: "['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests']" +# runs-on: ubuntu-latest +# needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] +# if: ${{ github.ref != 'refs/heads/staging' }} +# uses: ./.github/workflows/publish.yml # with: # ref: ${{ github.ref }} # steps: @@ -535,13 +539,16 @@ jobs: # - name: "publish" # uses: ./.github/actions/publish - publish-before-tests: -# name: Publish Without Tests + name: Publish Without Tests + uses: ./.github/workflows/publish.yml + with: + should_run: true + job_needs: "['build', 'build-fe', 'setup']" # runs-on: ubuntu-latest # needs: ['build', 'build-fe', 'setup'] #if: ${{ github.ref == 'refs/heads/staging' }} - uses: ./.github/workflows/publish.yml +# uses: ./.github/workflows/publish.yml # with: # ref: ${{ github.ref }} # steps: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 71d4fd6a661..229ce1a3a22 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,8 +2,12 @@ name: Publish on: workflow_call: inputs: - ref: - description: "The branch or tag being published" + should_run: + description: "Indicates if the job should be run" + required: true + type: boolean + job_needs: + description: "Comma-spepared list of jobs needed to run this one" required: true type: string secrets: @@ -19,7 +23,8 @@ on: jobs: publish: runs-on: ubuntu-latest - if: ${{ inputs.ref == 'refs/heads/staging' || inputs.ref == 'refs/heads/master' || inputs.ref == 'refs/heads/demo' || startsWith(inputs.ref, 'refs/heads/preview') || startsWith(inputs.ref, 'refs/heads/release') }} + if: ${{ inputs.should_run }} + needs: ${{ fromJSON(inputs.job_needs) }} env: nexusUrl: https://oss.sonatype.org/content/repositories/snapshots addDevArtifacts: true From f2be1de17db1675e61ea34c4c5bc9477e2e97124 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 11:44:31 +0100 Subject: [PATCH 17/21] another try --- .github/workflows/pr.yml | 2 ++ .github/workflows/publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f4dcf9a8df3..c4a309c097a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -524,6 +524,7 @@ jobs: publish-after-tests: name: Publish With Tests + needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] uses: ./.github/workflows/publish.yml with: should_run: true @@ -541,6 +542,7 @@ jobs: publish-before-tests: name: Publish Without Tests + needs: ['build', 'build-fe', 'setup'] uses: ./.github/workflows/publish.yml with: should_run: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 229ce1a3a22..0a9ea567016 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ on: required: true type: boolean job_needs: - description: "Comma-spepared list of jobs needed to run this one" + description: "JSON list of jobs needed to run this workflow" required: true type: string secrets: @@ -24,7 +24,7 @@ jobs: publish: runs-on: ubuntu-latest if: ${{ inputs.should_run }} - needs: ${{ fromJSON(inputs.job_needs) }} + #needs: ${{ fromJSON(inputs.job_needs) }} env: nexusUrl: https://oss.sonatype.org/content/repositories/snapshots addDevArtifacts: true From c80d08a0f0065161313cc9cab0e73f7c5bd8daef Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 12:03:48 +0100 Subject: [PATCH 18/21] another try --- .github/workflows/pr.yml | 21 +++++++++++++++++--- .github/workflows/publish.yml | 36 ++++++++++++++++++++--------------- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c4a309c097a..5b29b08873f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -528,8 +528,16 @@ jobs: uses: ./.github/workflows/publish.yml with: should_run: true - job_needs: "['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests']" -# runs-on: ubuntu-latest +# job_needs: "['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests']" + secrets: + nussknacker_version: ${{ needs.setup.outputs.nk_snapshot_version }} + git_source_branch: ${{ needs.setup.outputs.git_source_branch }} + sonatype_user: ${{ secrets.SONATYPE_USER }} + sonatype_password: ${{ secrets.SONATYPE_PASSWORD }} + github_token: ${{ secrets.GITHUB_TOKEN }} + dockerhub_user: ${{ secrets.DOCKERHUB_USER }} + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} + # runs-on: ubuntu-latest # needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] # if: ${{ github.ref != 'refs/heads/staging' }} # uses: ./.github/workflows/publish.yml @@ -546,7 +554,14 @@ jobs: uses: ./.github/workflows/publish.yml with: should_run: true - job_needs: "['build', 'build-fe', 'setup']" + secrets: + nussknacker_version: ${{ needs.setup.outputs.nk_snapshot_version }} + git_source_branch: ${{ needs.setup.outputs.git_source_branch }} + sonatype_user: ${{ secrets.SONATYPE_USER }} + sonatype_password: ${{ secrets.SONATYPE_PASSWORD }} + github_token: ${{ secrets.GITHUB_TOKEN }} + dockerhub_user: ${{ secrets.DOCKERHUB_USER }} + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} # runs-on: ubuntu-latest # needs: ['build', 'build-fe', 'setup'] #if: ${{ github.ref == 'refs/heads/staging' }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a9ea567016..10feccc0622 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,18 +6,24 @@ on: description: "Indicates if the job should be run" required: true type: boolean - job_needs: - description: "JSON list of jobs needed to run this workflow" - required: true - type: string +# job_needs: +# description: "JSON list of jobs needed to run this workflow" +# required: true +# type: string secrets: - SONATYPE_USER: + nussknacker_version: + required: true + git_source_branch: + required: true + sonatype_user: + required: true + sonatype_password: required: true - SONATYPE_PASSWORD: + github_token: required: true - DOCKERHUB_USER: + dockerhub_user: required: true - DOCKERHUB_TOKEN: + dockerhub_token: required: true jobs: @@ -28,16 +34,16 @@ jobs: env: nexusUrl: https://oss.sonatype.org/content/repositories/snapshots addDevArtifacts: true - NUSSKNACKER_VERSION: ${{ needs.setup.outputs.nk_snapshot_version }} - GIT_SOURCE_BRANCH: ${{ needs.setup.outputs.git_source_branch }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USER }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + NUSSKNACKER_VERSION: ${{ secrets.nussknacker_version }} + GIT_SOURCE_BRANCH: ${{ secrets.git_source_branch }} + SONATYPE_USERNAME: ${{ secrets.sonatype_user }} + SONATYPE_PASSWORD: ${{ secrets.sonatype_password }} steps: - name: Cancel previous runs if: github.event_name != 'push' uses: styfle/cancel-workflow-action@0.11.0 with: - access_token: ${{ secrets.GITHUB_TOKEN }} + access_token: ${{ secrets.github_token }} - uses: actions/checkout@v3 - uses: coursier/setup-action@v1 with: @@ -66,8 +72,8 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v1 with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ secrets.dockerhub_user }} + password: ${{ secrets.dockerhub_token }} - name: Setup buildx builder uses: docker/setup-buildx-action@v3 with: From 9a8d792bb82b2e8e0f65d206b1f897affeef5822 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 12:05:08 +0100 Subject: [PATCH 19/21] another try --- .github/workflows/pr.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5b29b08873f..5438a1e31fb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -534,7 +534,7 @@ jobs: git_source_branch: ${{ needs.setup.outputs.git_source_branch }} sonatype_user: ${{ secrets.SONATYPE_USER }} sonatype_password: ${{ secrets.SONATYPE_PASSWORD }} - github_token: ${{ secrets.GITHUB_TOKEN }} + github__token: ${{ secrets.GITHUB_TOKEN }} dockerhub_user: ${{ secrets.DOCKERHUB_USER }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} # runs-on: ubuntu-latest @@ -559,7 +559,7 @@ jobs: git_source_branch: ${{ needs.setup.outputs.git_source_branch }} sonatype_user: ${{ secrets.SONATYPE_USER }} sonatype_password: ${{ secrets.SONATYPE_PASSWORD }} - github_token: ${{ secrets.GITHUB_TOKEN }} + github__token: ${{ secrets.GITHUB_TOKEN }} dockerhub_user: ${{ secrets.DOCKERHUB_USER }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} # runs-on: ubuntu-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 10feccc0622..be6656a3945 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ on: required: true sonatype_password: required: true - github_token: + github__token: required: true dockerhub_user: required: true @@ -43,7 +43,7 @@ jobs: if: github.event_name != 'push' uses: styfle/cancel-workflow-action@0.11.0 with: - access_token: ${{ secrets.github_token }} + access_token: ${{ secrets.github__token }} - uses: actions/checkout@v3 - uses: coursier/setup-action@v1 with: From 927ebeddb5234bcc68c12cbd3c056a145250bec4 Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 14:32:26 +0100 Subject: [PATCH 20/21] cleanup --- .github/workflows/pr.yml | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5438a1e31fb..7196b1f7ee3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -527,8 +527,7 @@ jobs: needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] uses: ./.github/workflows/publish.yml with: - should_run: true -# job_needs: "['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests']" + should_run: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/demo' || startsWith(github.ref, 'refs/heads/preview') || startsWith(github.ref, 'refs/heads/release') }} secrets: nussknacker_version: ${{ needs.setup.outputs.nk_snapshot_version }} git_source_branch: ${{ needs.setup.outputs.git_source_branch }} @@ -537,23 +536,13 @@ jobs: github__token: ${{ secrets.GITHUB_TOKEN }} dockerhub_user: ${{ secrets.DOCKERHUB_USER }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} - # runs-on: ubuntu-latest -# needs: ['build', 'build-fe', 'setup', 'tests', 'integrationTests', 'slowTests', 'frontendTests', 'cypressTests'] -# if: ${{ github.ref != 'refs/heads/staging' }} -# uses: ./.github/workflows/publish.yml -# with: -# ref: ${{ github.ref }} -# steps: -# - uses: actions/checkout@v1 -# - name: "publish" -# uses: ./.github/actions/publish publish-before-tests: name: Publish Without Tests needs: ['build', 'build-fe', 'setup'] uses: ./.github/workflows/publish.yml with: - should_run: true + should_run: ${{ github.ref == 'refs/heads/staging' }} secrets: nussknacker_version: ${{ needs.setup.outputs.nk_snapshot_version }} git_source_branch: ${{ needs.setup.outputs.git_source_branch }} @@ -562,18 +551,6 @@ jobs: github__token: ${{ secrets.GITHUB_TOKEN }} dockerhub_user: ${{ secrets.DOCKERHUB_USER }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} -# runs-on: ubuntu-latest -# needs: ['build', 'build-fe', 'setup'] - #if: ${{ github.ref == 'refs/heads/staging' }} -# uses: ./.github/workflows/publish.yml -# with: -# ref: ${{ github.ref }} -# steps: -# - uses: actions/checkout@v1 -# - name: "publish" -# uses: ./.github/actions/publish -# with: -# ref: ${{ github.ref }} trigger-external-build: runs-on: ubuntu-latest From 56673da612ddfbc671e1e86372d2fe7f42e9584f Mon Sep 17 00:00:00 2001 From: MK Software Date: Wed, 22 Jan 2025 14:41:41 +0100 Subject: [PATCH 21/21] cleanup --- .github/workflows/publish.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index be6656a3945..0ceeb212874 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,10 +6,6 @@ on: description: "Indicates if the job should be run" required: true type: boolean -# job_needs: -# description: "JSON list of jobs needed to run this workflow" -# required: true -# type: string secrets: nussknacker_version: required: true @@ -30,7 +26,6 @@ jobs: publish: runs-on: ubuntu-latest if: ${{ inputs.should_run }} - #needs: ${{ fromJSON(inputs.job_needs) }} env: nexusUrl: https://oss.sonatype.org/content/repositories/snapshots addDevArtifacts: true