-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Build cuda docker container on publish | ||
on: | ||
release: | ||
types: [ created, edited ] | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'tag' | ||
required: true | ||
default: 'latest' | ||
type: string | ||
jobs: | ||
var: | ||
name: Set variables | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image-cuda-dev: "ghcr.io/mutablelogic/cuda-dev" | ||
image-cuda-runtime: "ghcr.io/mutablelogic/cuda-rt" | ||
tag: ${{ steps.var.outputs.tag }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set variables | ||
id: var | ||
run: | | ||
if [ "${{ github.event_name }}" != "release" ] && [ "${{ inputs.tag }}" != "latest" ]; then | ||
TAG="${{ inputs.tag }}" && echo "tag=${TAG#v}" >> $GITHUB_OUTPUT | ||
else | ||
TAG="$(git describe --tags)" && echo "tag=${TAG#v}" >> $GITHUB_OUTPUT | ||
fi | ||
build: | ||
name: Build | ||
needs: var | ||
strategy: | ||
matrix: | ||
arch: [ amd64, arm64 ] | ||
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || matrix.arch == 'arm64' && 'nx1' }} | ||
env: | ||
ARCH: ${{ matrix.arch }} | ||
OS: linux | ||
DOCKER_REGISTRY: ghcr.io/mutablelogic | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and Push | ||
id: build | ||
run: | | ||
git checkout v${{ needs.var.outputs.tag }} | ||
make docker-cuda-push | ||
manifest: | ||
name: Create manifest | ||
needs: | ||
- build | ||
- var | ||
strategy: | ||
matrix: | ||
image: | ||
- ${{ needs.var.outputs.image-cuda-dev }} | ||
- ${{ needs.var.outputs.image-cuda-runtime }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create | ||
run: | | ||
docker manifest create ${{ matrix.image }}:${{ needs.var.outputs.tag }} \ | ||
--amend ${{ matrix.image }}-linux-amd64:${{ needs.var.outputs.tag }} \ | ||
--amend ${{ matrix.image }}-linux-arm64:${{ needs.var.outputs.tag }} | ||
- name: Annotate | ||
run: | | ||
docker manifest annotate --arch arm64 --os linux \ | ||
${{ matrix.image }}:${{ needs.var.outputs.tag }} \ | ||
${{ matrix.image }}-linux-arm64:${{ needs.var.outputs.tag }} | ||
docker manifest annotate --arch amd64 --os linux \ | ||
${{ matrix.image }}:${{ needs.var.outputs.tag }} \ | ||
${{ matrix.image }}-linux-amd64:${{ needs.var.outputs.tag }} | ||
- name: Push | ||
run: | | ||
docker manifest push ${{ matrix.image }}:${{ needs.var.outputs.tag }} |
2 changes: 1 addition & 1 deletion
2
.github/workflows/on_publish.yaml → ...rkflows/on_publish_llamacpp.yaml_disabled
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters