This is an automated email from the ASF dual-hosted git repository.
miki3421 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-admin-api.git
The following commit(s) were added to refs/heads/main by this push:
new c7fc69e alignin workflow (#45)
c7fc69e is described below
commit c7fc69e5916e35c0c1f611ee1500fb9f7ef059ad
Author: Michele Sciabarra <[email protected]>
AuthorDate: Tue Sep 8 07:21:53 2026 +0200
alignin workflow (#45)
Co-authored-by: Michele Sciabarra <[email protected]>
---
.asf.yaml | 13 ---------
.github/workflows/check.yml | 18 ++++++------
.github/workflows/image.yml | 68 +++++++++++++++++++++++++++++++++++++--------
3 files changed, 66 insertions(+), 33 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index 47cbc09..00e1050 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -36,16 +36,3 @@ github:
- root
restrict_deletion: true
restrict_force_push: true
- protected_branches:
- 0.9.0:
- required_pull_request_reviews:
- required_approving_review_count: 1
-
- main:
- required_linear_history: true
- required_status_checks:
- strict: true
- required_pull_request_reviews:
- required_approving_review_count: 1
- dismiss_stale_reviews: true
- required_conversation_resolution: true
\ No newline at end of file
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index c454c3a..f911204 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -16,26 +16,26 @@
# under the License.
#
-name: openserverless-admin-api-check
-on:
- push:
- branches: [main]
+name: Check
+on:
pull_request:
- branches: [main]
+ workflow_dispatch:
jobs:
check:
name: Check OpenServerless Admin Api
runs-on: ubuntu-22.04
+ permissions:
+ contents: read
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v7
with:
submodules: recursive
- - name: License
- uses: apache/skywalking-eyes@main
+ - name: License
+ uses: apache/[email protected]
- name: Set up Python 3.12
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v7
with:
python-version: 3.12
- name: Setup
diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml
index e161a24..e299a17 100644
--- a/.github/workflows/image.yml
+++ b/.github/workflows/image.yml
@@ -16,31 +16,48 @@
# under the License.
#
-name: Build OpenServerless Admin Api
+name: Build Image
on:
push:
tags:
- - '[0-9]*'
+ - '*.*.*.*'
branches-ignore:
- '*'
+ workflow_dispatch:
jobs:
image:
name: Build OpenServerless Admin Api
runs-on: ubuntu-latest
+ 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: Setup
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: License
- uses: apache/skywalking-eyes@main
+ uses: apache/[email protected]
- name: Assign TAG from pull request
if: ${{ github.event_name == 'pull_request' }}
run: |
@@ -49,12 +66,44 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
+ - name: Generate .env
+ run: |
+ OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]'
'[:lower:]')
+ if [ "$OWNER" = "apache" ]; then
+ IMAGE=$(awk -F= '/ARG ADMINAPI_IMAGE_DEFAULT=/ { print $2 ; exit
}' Dockerfile)
+ else
+ IMAGE="ghcr.io/$OWNER/openserverless-admin-api"
+ fi
+ echo "GITHUB_USER=$OWNER" > .env
+ echo "MY_ADMINAPI_IMAGE=$IMAGE" >> .env
+ cat .env
+ - name: Select registry
+ env:
+ DOCKERHUB_REGISTRY: ${{ secrets.DOCKERHUB_REGISTRY }}
+ run: |
+ if [ -n "$DOCKERHUB_REGISTRY" ]; then
+ REGISTRY="$DOCKERHUB_REGISTRY"
+ elif [ "${{ github.repository_owner }}" = "apache" ]; then
+ REGISTRY="docker.io"
+ else
+ REGISTRY="ghcr.io"
+ fi
+ echo "REGISTRY=$REGISTRY" >> "$GITHUB_ENV"
+ - name: Select registry credentials
+ run: |
+ if [ "${REGISTRY%%/*}" = "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@af1e73f918a031802d376d3c8bbc3fe56130a9b0 #
v4.4.0
with:
- registry: registry.hub.docker.com
- username: ${{ secrets.DOCKERHUB_USER }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
+ registry: ${{ env.REGISTRY }}
+ username: ${{ env.REGISTRY_USER }}
+ password: ${{ env.REGISTRY_TOKEN }}
- name: Set up QEMU
uses:
docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
with:
@@ -62,7 +111,4 @@ jobs:
- name: Set up Docker Buildx
uses:
docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Image
- env:
- REGISTRY: apache
- NAMESPACE: apache
- run: task buildx PUSH=1 TAG=$IMG_TAG
+ run: task buildx PUSH=1 ADMINAPI_TAG=$IMG_TAG
\ No newline at end of file