main-build.yml•2.88 kB
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build Main
on:
workflow_dispatch:
push:
branches:
- main
- release-prep
tags:
- wanaku-*
paths-ignore:
- .github/**
- docs/**
- artwork/**
- README.md
- docker-*
- index.md
- jbang-catalog.json
- Makefile
- LICENSE
env:
PROJECTS: ${{ github.workspace }}
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set arch
id: arch
run: echo "arch=$(uname -m)" >> $GITHUB_OUTPUT
- name: Login to Container Registry
if: github.repository == 'wanaku-ai/wanaku'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and Publish (x86)
if: matrix.os == 'ubuntu-latest' && github.repository == 'wanaku-ai/wanaku'
run: |
mvn -B clean package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.tag=${{ github.ref_name }}-${{ steps.arch.outputs.arch }} \
-Dquarkus.jib.platforms=linux/amd64 \
-Pdist
- name: Build and Publish (arm)
if: matrix.os == 'ubuntu-24.04-arm' && github.repository == 'wanaku-ai/wanaku'
run: |
mvn -B clean package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.tag=${{ github.ref_name }}-${{ steps.arch.outputs.arch }} \
-Dquarkus.jib.platforms=linux/arm64/v8 \
-Pdist
createManifests:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Container Registry
if: github.repository == 'wanaku-ai/wanaku'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and Publish (x86)
if: github.repository == 'wanaku-ai/wanaku'
run: |
./build-manifests.sh ${{ github.ref_name }}