[maven] (deps): Bump org.graalvm.buildtools:native-maven-plugin from 0.9.27 to 0.9.28 #185
Workflow file for this run
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
name: Build and publish Docker images | |
# 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. | |
on: | |
push: | |
branches: [ "**" ] | |
# Publish semver tags as releases. | |
tags: [ 'v*.*.*' ] | |
paths-ignore: | |
- "Website/**" | |
- "*.md" | |
- "*.txt" | |
- "qodana.yaml" | |
pull_request: | |
paths-ignore: | |
- "Website/**" | |
- "*.md" | |
- "*.txt" | |
- "qodana.yaml" | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build: | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
filename: [ CLI/Dockerfile, GUI/Dockerfile ] | |
docker_context: [CLI, GUI] | |
image_name: [ drifty-cli, drifty-gui ] | |
exclude: | |
- filename: GUI/Dockerfile | |
docker_context: CLI | |
image_name: drifty-cli | |
- filename: GUI/Dockerfile | |
docker_context: GUI | |
image_name: drifty-cli | |
- filename: GUI/Dockerfile | |
docker_context: CLI | |
image_name: drifty-gui | |
- filename: CLI/Dockerfile | |
docker_context: GUI | |
image_name: drifty-gui | |
- filename: CLI/Dockerfile | |
docker_context: CLI | |
image_name: drifty-gui | |
- filename: CLI/Dockerfile | |
docker_context: GUI | |
image_name: drifty-cli | |
fail-fast: false | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install build dependencies | |
run: | | |
sudo apt-get install libasound2-dev libavcodec-dev libavformat-dev libavutil-dev libfreetype6-dev | |
sudo apt-get install libgl-dev libglib2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libxtst-dev zlib1g-dev | |
- name: Set up GraalVM JDK 20.0.1 | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '20.0.1' | |
distribution: 'graalvm-community' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
set-java-home: true | |
cache: 'maven' | |
components: 'native-image' | |
- name: Package Drifty CLI with GraalVM | |
if: matrix.filename == 'CLI/Dockerfile' | |
run: mvn -Pbuild-drifty-cli-for-ubuntu-latest package | |
- name: Set Up Maven version 3.8.8 # For GUI build issues, maven version 3.8.8 needs to be used | |
if: matrix.filename == 'GUI/Dockerfile' | |
uses: stCarolas/setup-maven@v4.5 | |
with: | |
maven-version: 3.8.8 | |
- name: Build platform-specific C object for missing jdk libraries | |
if: matrix.filename == 'GUI/Dockerfile' | |
run: gcc -c config/missing_symbols.c -o config/missing_symbols-ubuntu-latest.o | |
- name: Package Drifty GUI with GraalVM | |
if: matrix.filename == 'GUI/Dockerfile' | |
run: mvn -Pbuild-drifty-gui-for-ubuntu-latest gluonfx:build gluonfx:package | |
- name: Categorise build artifacts for CLI | |
if: matrix.filename == 'CLI/Dockerfile' | |
run: | | |
mkdir CLI | |
mv "target/CLI/linux/Drifty CLI" "target/CLI/linux/Drifty_CLI" | |
mv "target/CLI/linux/Drifty_CLI" -t CLI | |
- name: Categorise build artifacts for GUI | |
if: matrix.filename == 'GUI/Dockerfile' | |
run: | | |
mkdir GUI | |
mv target/gluonfx/x86_64-linux/Drifty "target/gluonfx/x86_64-linux/Drifty_GUI" | |
mv "target/gluonfx/x86_64-linux/Drifty_GUI" -t GUI | |
# Install the cosign tool except on PR | |
# https://github.com/sigstore/cosign-installer | |
- name: Install cosign | |
if: github.event_name != 'pull_request' && github.repository == 'SaptarshiSarkar12/Drifty' | |
uses: sigstore/cosign-installer@v3.1.2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# Set up BuildKit Docker container builder to be able to build | |
# multi-platform images and export cache | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.0.0 | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry | |
if: github.event_name != 'pull_request' && github.repository == 'SaptarshiSarkar12/Drifty' | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5.0.0 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image_name }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=sha | |
flavor: | | |
latest=auto | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v5.0.0 | |
with: | |
context: ${{ matrix.docker_context }} | |
push: ${{ github.event_name != 'pull_request' && github.repository == 'SaptarshiSarkar12/Drifty' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: Docker/prod/${{ matrix.filename }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
# Sign the resulting Docker image digest except on PRs. | |
# This will only write to the public Rekor transparency log when the Docker | |
# repository is public to avoid leaking data. If you would like to publish | |
# transparency data even for private images, pass --force to cosign below. | |
# https://github.com/sigstore/cosign | |
- name: Sign the published Docker image | |
if: github.event_name != 'pull_request' && github.repository == 'SaptarshiSarkar12/Drifty' | |
env: | |
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable | |
TAGS: ${{ steps.meta.outputs.tags }} | |
DIGEST: ${{ steps.build-and-push.outputs.digest }} | |
# This step uses the identity token to provision an ephemeral certificate | |
# against the sigstore community Fulcio instance. | |
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} |