This is an automated email from the ASF dual-hosted git repository.

sciabarracom pushed a commit to branch 0.9.0
in repository https://gitbox.apache.org/repos/asf/openserverless-build.git


The following commit(s) were added to refs/heads/0.9.0 by this push:
     new 2c7167f  reworked build
2c7167f is described below

commit 2c7167fdcef9e06b0b8edea70c7f0cc094b47d52
Author: Michele Sciabarra <[email protected]>
AuthorDate: Fri Sep 4 19:59:13 2026 +0200

    reworked build
---
 .env.dist                                       | 22 ++++++++++++-
 .github/workflows/check.yml                     | 17 +++++-----
 .github/workflows/{distdocker.yml => image.yml} | 42 ++++++++++++++++++++-----
 Taskfile.yml                                    | 33 ++++++++++++++++---
 4 files changed, 93 insertions(+), 21 deletions(-)

diff --git a/.env.dist b/.env.dist
index 7e7c50e..80183a7 100644
--- a/.env.dist
+++ b/.env.dist
@@ -1,2 +1,22 @@
+# github user, used to derive the default local image names
+GITHUB_USER=github: put here your github user
+
+# for the github registry (ghcr.io)
 GH_USER=<github user>
-GH_TOKEN=<github token> 
+GH_TOKEN=<github token>
+
+# for dockerhub
+DOCKERHUB_USER=
+DOCKERHUB_TOKEN=
+
+# This component builds MULTIPLE images (see BUILD.md, case B).
+# Each variable holds the image NAME ONLY (no registry, no tag): the registry
+# comes from DOCKER_REGISTRY and the tag from "task tag".
+MY_CONTROLLER_IMAGE=openserverless-wsk-controller
+MY_INVOKER_IMAGE=openserverless-wsk-invoker
+MY_SCHEDULER_IMAGE=openserverless-wsk-scheduler
+MY_STANDALONE_IMAGE=openserverless-wsk-standalone
+
+# where the images are pushed - defaults to docker.io/apache
+# for your own builds use e.g. ghcr.io/<your-user>
+#DOCKER_REGISTRY=ghcr.io/<your-user>
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 0bb960b..6bba458 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -16,26 +16,27 @@
 # under the License.
 #
 
-name: Check OpenServerless OpenWhisk 2 based images
+name: Check
 
-on: 
+on:
   push:
-    branches: [main]
   pull_request:
-    branches: [main]
+  workflow_dispatch:
 
 jobs:
-  distdocker:
-    name: Build OpenServerless OpenWhisk 2 based images
+  check:
+    name: Check OpenServerless OpenWhisk 2 based images
     runs-on: ubuntu-22.04
+    permissions:
+      contents: read
     steps:
       - name: Remove unnecessary files
         run: |
           sudo rm -rf /usr/share/dotnet
           sudo rm -rf "$AGENT_TOOLSDIRECTORY"    
       - name: Checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v7
         with:
           submodules: recursive
       - name: License
-        uses: apache/skywalking-eyes@main  
\ No newline at end of file
+        uses: apache/[email protected]  
\ No newline at end of file
diff --git a/.github/workflows/distdocker.yml b/.github/workflows/image.yml
similarity index 60%
rename from .github/workflows/distdocker.yml
rename to .github/workflows/image.yml
index 44500cf..7f12c6c 100644
--- a/.github/workflows/distdocker.yml
+++ b/.github/workflows/image.yml
@@ -16,7 +16,7 @@
 # under the License.
 #
 
-name: Build OpenServerless OpenWhisk 2 based images
+name: Build Image
 
 on:
   push:
@@ -24,23 +24,40 @@ on:
     - '[0-9]*'
     branches-ignore:
     - '*'
+  workflow_dispatch:
 jobs:
   distdocker:
     name: Build OpenServerless OpenWhisk 2 based images
     runs-on: ubuntu-22.04
+    permissions:
+      contents: write
+      packages: write
     steps:
       - name: Remove unnecessary files
         run: |
           sudo rm -rf /usr/share/dotnet
           sudo rm -rf "$AGENT_TOOLSDIRECTORY"    
       - name: Checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v7
         with:
           submodules: recursive
+          # full history and tags: "task tag" replaces the existing tags
+          # and "git describe" needs them to be present
+          fetch-depth: 0
       - name: License
-        uses: apache/skywalking-eyes@main
+        uses: apache/[email protected]
       - name: Setup CI
         run: bash .github/cisetup.sh                   
+      # Manual run: create a new snapshot tag on the current HEAD and push it.
+      # The push of the tag does not start another run (GITHUB_TOKEN pushes do
+      # not trigger workflows), so this same run goes on and builds it.
+      - name: Tag HEAD (manual run)
+        if: ${{ github.event_name == 'workflow_dispatch' }}
+        run: |
+          git config user.name "github-actions[bot]"
+          git config user.email 
"41898282+github-actions[bot]@users.noreply.github.com"
+          task tag
+          task ci
       - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
@@ -64,17 +81,26 @@ jobs:
         run: |
           echo "REPO_URL=registry.hub.docker.com" >> "$GITHUB_ENV"
           echo "DOCKER_REGISTRY=registry.hub.docker.com/apache" >> 
"$GITHUB_ENV"         
+      - name: Select registry credentials
+        run: |
+          if [ "${REPO_URL%%/*}" = "ghcr.io" ]; then
+            echo "REGISTRY_USER=${{ github.actor }}" >> "$GITHUB_ENV"
+            echo "REGISTRY_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
+          else
+            echo "REGISTRY_USER=${{ secrets.DOCKERHUB_USER }}" >> "$GITHUB_ENV"
+            echo "REGISTRY_TOKEN=${{ secrets.DOCKERHUB_TOKEN }}" >> 
"$GITHUB_ENV"
+          fi
       - name: Registry login
-        uses: docker/login-action@v3
+        uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # 
v4.6.0
         with:
           registry: ${{ env.REPO_URL }}
-          username: ${{ secrets.DOCKERHUB_USER }}
-          password: ${{ secrets.DOCKERHUB_TOKEN }}                     
+          username: ${{ env.REGISTRY_USER }}
+          password: ${{ env.REGISTRY_TOKEN }}
       - name: Set up QEMU
-        uses: docker/setup-qemu-action@v3
+        uses: 
docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0
         with:
           image: tonistiigi/binfmt:qemu-v7.0.0-28
       - name: Set up Docker Buildx
-        uses: docker/setup-buildx-action@v3
+        uses: 
docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
       - name: Dist Docker
         run: task buildx-and-push TAG="$IMG_TAG" DOCKER_REGISTRY="${{ 
env.DOCKER_REGISTRY }}"
\ No newline at end of file
diff --git a/Taskfile.yml b/Taskfile.yml
index 8a08c1f..1318366 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -22,6 +22,7 @@ dotenv:
 
 vars:
   BASETAG: 2.0.0-incubating
+  SUFFIX: "-SNAPSHOT"
   TAG:
     sh: |
       if test -n "${TAG:-}"; then
@@ -91,10 +92,34 @@ tasks:
           exit 1
         fi
 
+  # deprecated - use task tag
   image-tag:
-    - git tag -d $(git tag)
-    - git tag -f {{.BASETAG}}.$(date +%y%m%d%H%M){{.S}}
-    - task show
+    desc: "[deprecated] use task tag"
+    silent: true
+    cmds:
+      - 'echo "deprecated, use task tag"'
+
+  tag:
+    desc: |
+      Create a new snapshot tag for the current git commit.
+      NOTE: this deletes the existing local tags first - snapshot tags are 
disposable.
+    silent: true
+    vars:
+      TS:
+        sh: date '+%y %m %d %H %M' | awk '{printf "%s%s%d%s%d\n", $1, 
substr("abcdefghijkl",$2+0,1), $3, substr("abcdefghijklmnopqrstuvwx",$4+1,1), 
$5}'
+    cmds:
+      - git tag -d $(git tag) 2>/dev/null || true
+      - |
+        TAG="{{.BASETAG}}.{{.TS}}{{.SUFFIX}}"
+        git tag -f $TAG
+        echo New tag $TAG
+
+  ci:
+    desc: |
+      Push the tags, starting the GitHub Actions build on the repo that 
received them.
+      This does not build anything locally.
+    cmds:
+      - git push --tags --force
 
   show:
     silent: true
@@ -103,7 +128,7 @@ tasks:
       - echo "scala:" {{.COMMON_IMAGE}}:{{.TAG}}
       - echo "controller:" 
${MY_CONTROLLER_IMAGE:-{{.CONTROLLER_IMAGE}}}:{{.TAG}}
       - echo "invoker:" ${MY_INVOKER_IMAGE:-{{.INVOKER_IMAGE}}}:{{.TAG}}
-      - echo "scheduler:" ${MY_SCHEDULER_IMAGE:-{{.INVOKER_IMAGE}}}:{{.TAG}}
+      - echo "scheduler:" ${MY_SCHEDULER_IMAGE:-{{.SCHEDULER_IMAGE}}}:{{.TAG}}
       - echo "standalone:" 
${MY_STANDALONE_IMAGE:-{{.STANDALONE_IMAGE}}}:{{.TAG}}
 
   compile:controller:

Reply via email to