Skip to content

Fixing workflow

Fixing workflow #34

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [ released ]
jobs:
build:
name: Build [JVM]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: corretto
cache: maven
- name: Build
run: make build
- name: Upload artifact [target]
uses: actions/upload-artifact@v4
with:
name: target
path: target
if-no-files-found: error
retention-days: 7
docker-jvm:
name: Docker [JVM]
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare version labels
uses: k15g/action-version-labels@edge
with:
prefix: project
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact [target]
uses: actions/download-artifact@v4
with:
name: target
path: target
- name: Lowercase github.repository
run: echo "IMAGE_NAME=`echo ${{github.repository}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
- name: Build and push [jvm-edge]
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:jvm-edge \
-f src/main/docker/Dockerfile.jvm \
--platform linux/amd64,linux/arm64 \
--push .
- name: Build and push [edge]
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:edge \
-f src/main/docker/Dockerfile.jvm \
--platform linux/amd64,linux/arm64 \
--push .
- name: Build and push [jvm-version]
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:jvm-${{ env.PROJECT_VERSION }} \
-f src/main/docker/Dockerfile.jvm \
--platform linux/amd64,linux/arm64 \
--push .
- name: Build and push [version]
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:${{ env.PROJECT_VERSION }} \
-f src/main/docker/Dockerfile.jvm \
--platform linux/amd64,linux/arm64 \
--push .
- name: Build and push [jvm-latest]
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:jvm-latest \
-f src/main/docker/Dockerfile.jvm \
--platform linux/amd64,linux/arm64 \
--push .
- name: Build and push [latest]
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:latest \
-f src/main/docker/Dockerfile.jvm \
--platform linux/amd64,linux/arm64 \
--push .
uber-jar:
name: Uber-JAR
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare version labels
uses: k15g/action-version-labels@edge
with:
prefix: project
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: corretto
cache: maven
- name: Build uber-JAR
run: make build build-uber
- name: Upload artifact [uber-jar]
uses: actions/upload-artifact@v4
with:
name: uber-jar
path: target/submit-runner.jar
if-no-files-found: error
retention-days: 7
- name: Upload asset
uses: k15g/action-github-asset-upload@edge
if: startsWith(github.ref, 'refs/tags/v')
with:
token: ${{ secrets.GITHUB_TOKEN }}
file: target/submit-runner.jar
name: submit-${{ env.PROJECT_VERSION }}-uberjar.jar
type: application/java-archive
label: Uber-JAR
native-amd64:
name: Native [amd64]
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare version labels
uses: k15g/action-version-labels@edge
with:
prefix: project
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact [target]
uses: actions/download-artifact@v4
with:
name: target
path: target
- name: Build native
run: make native
- name: Rename file
run: mv target/submit-runner target/submit-runner-linux-x86_64
- name: Upload artifact [native-amd64]
uses: actions/upload-artifact@v4
with:
name: native-amd64
path: target/submit-runner-linux-x86_64
if-no-files-found: error
retention-days: 7
- name: Upload asset
uses: k15g/action-github-asset-upload@edge
if: startsWith(github.ref, 'refs/tags/v')
with:
token: ${{ secrets.GITHUB_TOKEN }}
file: target/submit-runner-linux-x86_64
name: submit-${{ env.PROJECT_VERSION }}-native-linux-x86_64
label: Native [amd64]
native-arm64:
name: Native [arm64]
runs-on: ubuntu-24.04-arm
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare version labels
uses: k15g/action-version-labels@edge
with:
prefix: project
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact [target]
uses: actions/download-artifact@v4
with:
name: target
path: target
- name: Build native
run: make native
- name: Rename file
run: mv target/submit-runner target/submit-runner-linux-aarch64
- name: Upload artifact [native-arm64]
uses: actions/upload-artifact@v4
with:
name: native-arm64
path: target/submit-runner-linux-aarch64
if-no-files-found: error
retention-days: 7
- name: Upload asset
uses: k15g/action-github-asset-upload@edge
if: startsWith(github.ref, 'refs/tags/v')
with:
token: ${{ secrets.GITHUB_TOKEN }}
file: target/submit-runner-linux-aarch64
name: submit-${{ env.PROJECT_VERSION }}-native-linux-aarch64
label: Native [arm64]
docker-native:
name: Docker [Native]
runs-on: ubuntu-latest
needs:
- native-amd64
- native-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare version labels
uses: k15g/action-version-labels@edge
with:
prefix: project
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact [native-amd64]
uses: actions/download-artifact@v4
with:
name: native-arm64
path: target
- name: Download artifact [native-amd64]
uses: actions/download-artifact@v4
with:
name: native-amd64
path: target
- name: Lowercase github.repository
run: echo "IMAGE_NAME=`echo ${{github.repository}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
- name: Build and push [native-edge]
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:native-edge \
-f src/main/docker/Dockerfile.native-micro \
--platform linux/amd64,linux/arm64 \
--push .
- name: Build and push [native-version]
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:native-${{ env.PROJECT_VERSION }} \
-f src/main/docker/Dockerfile.native-micro \
--platform linux/amd64,linux/arm64 \
--push .
- name: Build and push [native-latest]
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx build \
-t ghcr.io/${{ env.IMAGE_NAME }}:native-latest \
-f src/main/docker/Dockerfile.native-micro \
--platform linux/amd64,linux/arm64 \
--push .