Skip to content

build

build #73

Workflow file for this run

name: build
run-name: build
on:
push:
branches: ["*"]
tags:
- "v*"
env:
FLUTTER_ROOT: dummy
jobs:
tiecd-build-amd64:
runs-on: ubuntu-latest
container:
image: dart:3.3.4
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Dart code gen build
run: |
mkdir -p dist/bin
dart pub run flutter_oss_licenses:generate.dart -o dist/oss_licenses.json --json
dart run build_runner build
- name: Dart tests
run: dart test test
- name: Dart executable build
run: dart compile exe bin/tiecd.dart -o dist/bin/tiecd
- name: Tar artifacts
run: |
mkdir upload
tar -cvzf upload/tiecd-amd64.tgz dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-amd64
path: upload
retention-days: 1
tiecd-build-arm64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- run: |
docker buildx build -t tiecd/tiecdtarball -f Dockerfile.arm64 --platform linux/arm64 -o type=tar,dest=bins.tar .
- name: Exctract artifacts for upload
run: |
mkdir uplaod
tar -xvf bins.tar -C upload
- uses: actions/upload-artifact@v4
with:
name: build-artifacts-arm64
path: upload
retention-days: 1
# single arch images (amd64) using cekit fully
image-build-single-arch:
runs-on: ubuntu-latest
needs: [tiecd-build-amd64]
strategy:
fail-fast: false
matrix:
image: [
"jdk8","jdk11","jdk17","jdk21","vercel"
]
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: build-artifacts-*
merge-multiple: true
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/tiecd
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install CEKit
uses: cekit/[email protected]
- name: Save Tags
run: echo "${{ steps.meta.outputs.tags }}" >> tags.txt
- name: Save Labels
run: echo "${{ steps.meta.outputs.labels }}" >> labels.txt
- name: Build ${{ matrix.image }} Image
run: scripts/build-image.sh ${{ matrix.image }}
# multi arch builds, uses cekit to generate dockerfile, then buildx for actual build
# as cekit doesn't currently support buildx
image-build-multi-arch:
runs-on: ubuntu-latest
needs: [tiecd-build-amd64,tiecd-build-arm64]
strategy:
fail-fast: false
matrix:
image: [
"base","k8s","okd","gke","eks","aks","node18","node20"
]
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: build-artifacts-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install CEKit
uses: cekit/[email protected]
- name: Generate Dockerfile for ${{ matrix.image }} image
run: scripts/generate-build.sh ${{ matrix.image }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tiecd
labels: |
org.opencontainers.image.vendor=Dataaxiom Inc
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Save Tags
run: echo "${{ steps.meta.outputs.tags }}" >> tags.txt
- name: Generate Image Tags
id: gentags
run: |
tags=$(scripts/generate-tags.sh ${{ matrix.image }})
echo "tags=$tags" >> $GITHUB_OUTPUT
echo Using tags $image_tags
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: target/image
push: true
platforms: linux/arm64,linux/amd64
provenance: false
tags: ${{ steps.gentags.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.labels }}