Skip to content

Commit ebbded9

Browse files
committed
this
1 parent 238f508 commit ebbded9

File tree

3 files changed

+51
-33
lines changed

3 files changed

+51
-33
lines changed

.github/workflows/docker-build.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,31 @@ jobs:
2525
sudo apt-get update
2626
sudo apt-get install -y qemu-user-static
2727
28-
- name: Build and Push ${{ matrix.target }}
29-
env:
30-
DOCKER_CLI_EXPERIMENTAL: enabled
28+
- name: Prepare Environment
3129
run: |
3230
# Convert repository name to lowercase
3331
REPO="${{ github.repository }}"
3432
REPO="${REPO,,}"
35-
IMAGE_BASE=ghcr.io/$REPO/${{ matrix.target }}
36-
37-
docker build --platform linux/amd64 --target ${{ matrix.target }} -t ${IMAGE_BASE}:latest-amd64 .
38-
docker push ${IMAGE_BASE}:latest-amd64
33+
echo "IMAGE_BASE=ghcr.io/$REPO/${{ matrix.target }}" >> $GITHUB_ENV
34+
35+
- name: Build and Push amd64
36+
env:
37+
DOCKER_CLI_EXPERIMENTAL: enabled
38+
run: |
39+
docker build --platform linux/amd64 --target ${{ matrix.target }} -t ${{ env.IMAGE_BASE }}:latest-amd64 .
40+
docker push ${{ env.IMAGE_BASE }}:latest-amd64
3941
40-
docker build --platform linux/arm64 --target ${{ matrix.target }} -t ${IMAGE_BASE}:latest-arm64 .
41-
docker push ${IMAGE_BASE}:latest-arm64
42+
- name: Build and Push arm64
43+
env:
44+
DOCKER_CLI_EXPERIMENTAL: enabled
45+
run: |
46+
docker build --platform linux/arm64 --target ${{ matrix.target }} -t ${{ env.IMAGE_BASE }}:latest-arm64 .
47+
docker push ${{ env.IMAGE_BASE }}:latest-arm64
4248
43-
docker manifest create ${IMAGE_BASE}:latest \
44-
${IMAGE_BASE}:latest-amd64 \
45-
${IMAGE_BASE}:latest-arm64
49+
- name: Create and Push Manifest
50+
env:
51+
DOCKER_CLI_EXPERIMENTAL: enabled
52+
run: |
53+
docker manifest create ${{ env.IMAGE_BASE }}:latest ${{ env.IMAGE_BASE }}:latest-amd64 ${{ env.IMAGE_BASE }}:latest-arm64
4654
47-
docker manifest push ${IMAGE_BASE}:latest
55+
docker manifest push ${{ env.IMAGE_BASE }}:latest

.github/workflows/docker-release.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,33 @@ jobs:
2727
sudo apt-get update
2828
sudo apt-get install -y qemu-user-static
2929
30-
- name: Build and Push ${{ matrix.target }}
31-
env:
32-
DOCKER_CLI_EXPERIMENTAL: enabled
30+
- name: Prepare Environment
3331
run: |
3432
# Convert repository name to lowercase
3533
REPO="${{ github.repository }}"
3634
REPO="${REPO,,}"
37-
IMAGE_BASE=ghcr.io/$REPO/${{ matrix.target }}
38-
39-
# Determine version from tag
40-
VERSION=${{ github.ref_name }}
35+
echo "IMAGE_BASE=ghcr.io/$REPO/${{ matrix.target }}" >> $GITHUB_ENV
36+
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
4137
42-
docker build --platform linux/amd64 --target ${{ matrix.target }} -t ${IMAGE_BASE}:${VERSION}-amd64 .
43-
docker push ${IMAGE_BASE}:${VERSION}-amd64
38+
- name: Build and Push amd64
39+
env:
40+
DOCKER_CLI_EXPERIMENTAL: enabled
41+
run: |
42+
docker build --platform linux/amd64 --target ${{ matrix.target }} -t ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-amd64 .
43+
docker push ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-amd64
4444
45-
docker build --platform linux/arm64 --target ${{ matrix.target }} -t ${IMAGE_BASE}:${VERSION}-arm64 .
46-
docker push ${IMAGE_BASE}:${VERSION}-arm64
45+
- name: Build and Push arm64
46+
env:
47+
DOCKER_CLI_EXPERIMENTAL: enabled
48+
run: |
49+
docker build --platform linux/arm64 --target ${{ matrix.target }} -t ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-arm64 .
50+
docker push ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-arm64
4751
48-
docker manifest create ${IMAGE_BASE}:${VERSION} \
49-
${IMAGE_BASE}:${VERSION}-amd64 \
50-
${IMAGE_BASE}:${VERSION}-arm64
52+
- name: Create and Push Manifest
53+
env:
54+
DOCKER_CLI_EXPERIMENTAL: enabled
55+
run: |
56+
docker manifest create ${{ env.IMAGE_BASE }}:${{ env.VERSION }} ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-amd64 ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-arm64
5157
52-
docker manifest push ${IMAGE_BASE}:${VERSION}
58+
docker manifest push ${{ env.IMAGE_BASE }}:${{ env.VERSION }}
5359

.github/workflows/release-binaries.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,24 @@ jobs:
2020
- name: Install dependencies
2121
run: go mod download
2222

23-
- name: Build Binaries
24-
run: |
25-
mkdir -p dist
23+
- name: Prepare Dist Directory
24+
run: mkdir -p dist
2625

26+
- name: Build dragonctl
27+
run: |
2728
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/dragonctl-linux-amd64 ./cmd/dragonctl
2829
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/dragonctl-linux-arm64 ./cmd/dragonctl
2930
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/dragonctl-darwin-amd64 ./cmd/dragonctl
3031
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/dragonctl-darwin-arm64 ./cmd/dragonctl
3132
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/dragonctl-windows-amd64.exe ./cmd/dragonctl
3233
33-
# Build server components (Linux only)
34+
- name: Build Scheduler
35+
run: |
3436
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/scheduler-linux-amd64 ./cmd/scheduler
3537
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/scheduler-linux-arm64 ./cmd/scheduler
36-
38+
39+
- name: Build Token Server
40+
run: |
3741
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/k8s-kubeadm-token-server-linux-amd64 ./cmd/k8s-kubeadm-token-server
3842
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/k8s-kubeadm-token-server-linux-arm64 ./cmd/k8s-kubeadm-token-server
3943

0 commit comments

Comments
 (0)