Skip to content

Manual Build

Manual Build #51

Workflow file for this run

name: Manual Build
on:
workflow_dispatch:
inputs:
version:
description: 'Version of engine to build e.g. "3.4.4", "3.5"'
required: true
type: string
release_name:
description: 'Release name, usually "stable", but can also be something like "rc3", "beta1"'
type: string
default: "stable"
required: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: meldanor/godot-ci
jobs:
build:
strategy:
matrix:
versions:
[
{ tag: minimal, file: Dockerfile.minimal },
{ tag: andriod-ios, file: Dockerfile.android_ios },
{ tag: dotnet, file: Dockerfile.dotnet },
]
name: Build Image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- uses: actions/checkout@v4
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.5.0
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.versions.file }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY}}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}-${{ github.event.inputs.release_name}}-${{ matrix.versions.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64
build-args: |
GODOT_VERSION=${{ github.event.inputs.version }}
RELEASE_NAME=${{ github.event.inputs.release_name }}
# 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' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ env.REGISTRY}}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}-${{ github.event.inputs.release_name}}-${{ matrix.versions.tag }}
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}