Skip to content

Give the CI workflow a nicer name #23

Give the CI workflow a nicer name

Give the CI workflow a nicer name #23

Workflow file for this run

name: "BuildTestPublish"
on:
push:
branches: [ "*" ]
tags: [ "*" ]
paths-ignore: [ "README.md" ]
workflow_dispatch: { }
env:
JAVA_VERSION: "23"
jobs:
set_variables:
name: "Set build variables"
runs-on: "ubuntu-latest"
outputs:
build_version: "${{ steps.set_variables.outputs.build_version }}"
java_version: "${{ steps.set_variables.outputs.java_version }}"
docker_image: "${{ steps.set_variables.outputs.docker_image }}"
steps:
- id: "set_variables"
run: |
set -euo pipefail
echo "Setting workflow variables..."
BUILD_VERSION="jdk-${{ env.JAVA_VERSION }}.git-$(echo "$GITHUB_SHA" | head -c 7).build-$(date +'%Y%m%d%H%M')"
echo "build_version=$BUILD_VERSION" | tee -a "$GITHUB_OUTPUT"
JAVA_VERSION="$(echo "${{ env.JAVA_VERSION }}" | grep -E "^[0-9]+$")"
echo "java_version=$JAVA_VERSION" | tee -a "$GITHUB_OUTPUT"
DOCKER_IMAGE="$(echo "ghcr.io/$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]')"
echo "docker_image=$DOCKER_IMAGE" | tee -a "$GITHUB_OUTPUT"
build_hotspot:
name: "HotSpot"
runs-on: "ubuntu-latest"
needs: [ "set_variables" ]
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"
- name: "Install JDK"
uses: "actions/setup-java@v4"
with:
distribution: "corretto"
java-version: "${{ needs.set_variables.outputs.java_version }}"
- name: "Cache Maven repository"
uses: "actions/cache@v4"
with:
path: "${{ github.workspace }}/.ci/transient/m2-repo"
key: "${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pom.xml') }}"
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-
${{ runner.os }}-
- name: "Maven Build (JIT)"
uses: "./.github/actions/maven-build"
with:
BUILD_REVISION: "${{ needs.set_variables.outputs.build_version }}"
MAVEN_JOB_ARGS: "verify package"
- name: "Archive jarfile"
uses: "actions/upload-artifact@v4"
with:
name: "mcw.jar"
path: "target/mcw.jar"
build_graal:
name: "GraalVM"
runs-on: "ubuntu-latest"
needs: [ "set_variables", "build_hotspot" ]
container:
image: "ghcr.io/mangadex-pub/jdk-maven:${{ needs.set_variables.outputs.java_version }}-graal"
options: "--user root"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"
- name: "Cache Maven repository"
uses: "actions/cache@v4"
with:
path: "${{ github.workspace }}/.ci/transient/m2-repo"
key: "${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pom.xml') }}"
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-
${{ runner.os }}-
- name: "Maven Build (AOT)"
uses: "./.github/actions/maven-build"
with:
BUILD_REVISION: "${{ needs.set_variables.outputs.build_version }}"
MAVEN_JOB_ARGS: "package -Pnative -DskipTests"
- name: "Archive binary"
uses: "actions/upload-artifact@v4"
with:
name: "mcw-${{ runner.os }}-${{ runner.arch }}"
path: "target/mcw"