Skip to content

Commit

Permalink
Added gha to tag latest toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
andressbarajas committed Dec 6, 2024
1 parent 0395c50 commit 4dd3d91
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 61 deletions.
28 changes: 0 additions & 28 deletions .github/docker/README.md

This file was deleted.

49 changes: 25 additions & 24 deletions .github/workflows/gen-kos-toolchains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ on:

permissions:
packages: write
contents: read

jobs:
build-arm64:
runs-on: self-hosted
name: Build for ARM64
strategy:
matrix:
version:
- { tag: "13.3-legacy" }
- { tag: "14.2-stable" }
- { tag: "15.0-dev" }
tag:
- "13.3-legacy"
- "14.2-stable"
- "15.0-dev"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -55,22 +56,22 @@ jobs:
file: .github/docker/kos-Dockerfile
push: true
tags: |
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.version.tag }}-arm64
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.version.tag }}-arm64
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-arm64
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-arm64
platforms: linux/arm64
build-args: |
tag=${{ matrix.version.tag }}
tag=${{ matrix.tag }}
no-cache: true

build-amd64:
runs-on: ubuntu-latest
name: Build for AMD64
strategy:
matrix:
version:
- { tag: "13.3-legacy" }
- { tag: "14.2-stable" }
- { tag: "15.0-dev" }
tag:
- "13.3-legacy"
- "14.2-stable"
- "15.0-dev"
needs: build-arm64
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -99,22 +100,22 @@ jobs:
file: .github/docker/kos-Dockerfile
push: true
tags: |
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.version.tag }}-amd64
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.version.tag }}-amd64
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-amd64
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-amd64
platforms: linux/amd64
build-args: |
tag=${{ matrix.version.tag }}
tag=${{ matrix.tag }}
no-cache: true

merge-manifest:
runs-on: ubuntu-latest
name: Merge Docker Manifests
strategy:
matrix:
version:
- { tag: "13.3-legacy" }
- { tag: "14.2-stable" }
- { tag: "15.0-dev" }
tag:
- "13.3-legacy"
- "14.2-stable"
- "15.0-dev"
needs:
- build-arm64
- build-amd64
Expand All @@ -138,9 +139,9 @@ jobs:
- name: Create and Push Docker Manifest
run: |
docker buildx imagetools create \
--tag ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.version.tag }} \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.version.tag }} \
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.version.tag }}-arm64 \
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.version.tag }}-amd64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.version.tag }}-arm64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.version.tag }}-amd64
--tag ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }} \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }} \
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-arm64 \
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-amd64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-arm64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-amd64
46 changes: 46 additions & 0 deletions .github/workflows/gen-tag-latest-kos-toolchain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Tag Latest KOS-Toolchain

on:
workflow_dispatch:
workflow_run:
workflows:
- Generate KOS-Toolchain Docker Images
types:
- completed

permissions:
packages: write
contents: read

jobs:
tag-latest:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

# Tag latest kos-toolchains
- name: Create and Push Docker Latest Manifest
run: |
docker buildx imagetools create \
--tag ghcr.io/kallistiosunchained/dc-kos-toolchain:latest \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:latest \
ghcr.io/kallistiosunchained/dc-kos-toolchain:14.2-stable-arm64 \
ghcr.io/kallistiosunchained/dc-kos-toolchain:14.2-stable-amd64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:14.2-stable-arm64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:14.2-stable-amd64
46 changes: 46 additions & 0 deletions .github/workflows/gen-tag-latest-toolchain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Tag Latest Toolchain

on:
workflow_dispatch:
workflow_run:
workflows:
- Generate Toolchain Docker Images
types:
- completed

permissions:
packages: write
contents: read

jobs:
tag-latest:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

# Tag latest toolchains
- name: Create and Push Docker Latest Manifest
run: |
docker buildx imagetools create \
--tag ghcr.io/kallistiosunchained/dc-toolchain:latest \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:latest \
ghcr.io/kallistiosunchained/dc-toolchain:14.2-stable-arm64 \
ghcr.io/kallistiosunchained/dc-toolchain:14.2-stable-amd64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:14.2-stable-arm64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:14.2-stable-amd64
13 changes: 4 additions & 9 deletions .github/workflows/pr-kos-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
toolchain:
tag:
- "13.3-legacy"
- "14.2-stable"
- "15.0-dev"
Expand All @@ -32,27 +32,22 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Convert Repository Owner to Lowercase
id: lower-owner
run: |
echo "repository_owner=${GITHUB_REPOSITORY%%/*}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_OUTPUT
- name: Pull Toolchain Image
run: |
docker pull ghcr.io/${{ steps.lower-owner.outputs.repository_owner }}/dc-toolchain:${{ matrix.toolchain }}
docker pull ghcr.io/kallistiosunchained/dc-toolchain:${{ matrix.tag }}
- name: Build SDK
run: |
docker run --rm \
-v ${{ github.workspace }}:/opt/toolchains/dc/kos \
-w /opt/toolchains/dc/kos \
ghcr.io/${{ steps.lower-owner.outputs.repository_owner }}/dc-toolchain:${{ matrix.toolchain }} \
ghcr.io/kallistiosunchained/dc-toolchain:${{ matrix.tag }} \
"source environ.sh.master && make all V=1 | tee build.log"
- name: Upload Build Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.toolchain }}-pr-${{ github.event.pull_request.number }}-${{ github.run_id }}
name: build-logs-${{ matrix.tag }}-pr-${{ github.event.pull_request.number }}-${{ github.run_id }}
path: build.log

0 comments on commit 4dd3d91

Please sign in to comment.