Skip to content

Commit

Permalink
fix: split 4 in 1 workflow file into 4 separate workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Nov 27, 2023
1 parent 6f80980 commit ae1fedc
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 154 deletions.
149 changes: 0 additions & 149 deletions .github/workflows/release-distributions.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/release-obagent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release obagent

on:
push:
tags:
- "obagent-*"

env:
tagName: ${{ github.ref_name }}

jobs:
release-obagent:
runs-on: ubuntu-latest
steps:
- name: Log in to Docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set Version variables
id: set_version_vars
run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*-\d*)' --only-matching)" >> $GITHUB_OUTPUT

- name: Build and push obagent w/o cache
uses: docker/build-push-action@v2
with:
context: ./distribution/obagent
platforms: linux/amd64,linux/arm64
file: ./distribution/obagent/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/obagent-cloud-native:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
43 changes: 43 additions & 0 deletions .github/workflows/release-obconfigserver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release obconfigserver

on:
push:
tags:
- "obconfigserver-*"

env:
tagName: ${{ github.ref_name }}

jobs:
release-obconfigserver:
runs-on: ubuntu-latest
steps:
- name: Log in to Docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set Version variables
id: set_version_vars
run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*-\d*)' --only-matching)" >> $GITHUB_OUTPUT

- name: Build and push obconfigserver w/o cache
uses: docker/build-push-action@v2
with:
context: ./distribution/ob-configserver
platforms: linux/amd64,linux/arm64
file: ./distribution/ob-configserver/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/obconfigserver-cloud-native:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
43 changes: 43 additions & 0 deletions .github/workflows/release-obproxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release obproxy

on:
push:
tags:
- "obproxy-*"

env:
tagName: ${{ github.ref_name }}

jobs:
release-obproxy:
runs-on: ubuntu-latest
steps:
- name: Log in to Docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set Version variables
id: set_version_vars
run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*\.\d*-\d*)' --only-matching)" >> $GITHUB_OUTPUT

- name: Build and push obproxy w/o cache
uses: docker/build-push-action@v2
with:
context: ./distribution/obproxy
platforms: linux/amd64,linux/arm64
file: ./distribution/obproxy/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/obproxy-cloud-native:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
43 changes: 43 additions & 0 deletions .github/workflows/release-observer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release observer

on:
push:
tags:
- "observer-*"

env:
tagName: ${{ github.ref_name }}

jobs:
release-observer:
runs-on: ubuntu-latest
steps:
- name: Log in to Docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set Version variables
id: set_version_vars
run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*\.\d*-\d{18})' --only-matching)" >> $GITHUB_OUTPUT

- name: Build and push observer w/o cache
uses: docker/build-push-action@v2
with:
context: ./distribution/oceanbase
platforms: linux/amd64,linux/arm64
file: ./distribution/oceanbase/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/oceanbase-cloud-native:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
3 changes: 2 additions & 1 deletion distribution/ob-configserver/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg ARCH=$3 .
# @Params TARGETPLATFORM linux/amd64 or linux/arm64
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 .
3 changes: 2 additions & 1 deletion distribution/obagent/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg ARCH=$3 .
# @Params TARGETPLATFORM linux/amd64 or linux/arm64
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 .
4 changes: 3 additions & 1 deletion distribution/obproxy/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/bash
docker build -t $1:$2-$3 --build-arg VERSION=$2 --build-arg RELEASE=$3 --build-arg ARCH=$4 .
# @Params TARGETPLATFORM linux/amd64 or linux/arm64
# VERSION: x.y.z-r e.g. 4.2.1-11 which merge old VERSION and RELEASE
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 .
4 changes: 2 additions & 2 deletions distribution/oceanbase/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker build -t $1:$2 --build-arg GOPROXY=${GOPROXY} --build-arg VERSION=$2 --build-arg ARCH=$3 .
# @Params TARGETPLATFORM linux/amd64 or linux/arm64
docker build -t $1:$2 --build-arg GOPROXY=${GOPROXY} --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 .

0 comments on commit ae1fedc

Please sign in to comment.