-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44fe4ec
commit b78e914
Showing
7 changed files
with
118 additions
and
84 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Docker images | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
base_image_tags: | ||
description: | | ||
List of image tags of the mcdreforged/mcdreforged image for the workflow to build as the base images, separated with ",". | ||
For example: "1.2.3,1.2.3-slim,1.2.3-py3.11,1.2.3-py3.11-slim" | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
build_matrix: | ||
name: Build matrix from input | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Build matrix | ||
id: matrix | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
let matrix = {'include': []} | ||
let summary = core.summary.addHeading('Input tags', true).addRaw('```', true) | ||
let tags = process.env.BASE_IMAGE_TAGS.split(',') | ||
tags.filter(tag => tag !== '').forEach(tag => { | ||
matrix.include.push({'base_image_tag': tag}) | ||
summary.addRaw(tag, true) | ||
}) | ||
console.log(`matrix:`) | ||
console.log(JSON.stringify(matrix, null, 2)) | ||
core.setOutput('matrix', JSON.stringify(matrix)) | ||
summary.addRaw('```', true).write() | ||
env: | ||
BASE_IMAGE_TAGS: ${{ inputs.base_image_tags }} | ||
|
||
outputs: | ||
matrix: ${{ steps.matrix.outputs.matrix }} | ||
|
||
images: | ||
needs: build_matrix | ||
strategy: | ||
matrix: ${{ fromJson(needs.build_matrix.outputs.matrix) }} | ||
|
||
uses: ./.github/workflows/image_derivatives.yml | ||
secrets: inherit | ||
with: | ||
source_tag: ${{ matrix.base_image_tag }} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: step.image_derivatives | ||
|
||
# image input: "mcdreforged/mcdreforged:<source_tag>" | ||
# These images will be built: | ||
# mcdreforged/mcdreforged-extra:<source_tag> | ||
# mcdreforged/mcdreforged-<jdk_distribution>:<source_tag> | ||
# mcdreforged/mcdreforged-<jdk_distribution>:<source_tag>-extra | ||
# mcdreforged/mcdreforged-<jdk_distribution>:<source_tag>-jdk<java> | ||
# mcdreforged/mcdreforged-<jdk_distribution>:<source_tag>-jdk<java>-extra | ||
on: | ||
workflow_call: | ||
inputs: | ||
source_tag: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
extra: | ||
uses: ./.github/workflows/image_one.yml | ||
secrets: inherit | ||
with: | ||
dockerfile_name: Dockerfile-base | ||
build_args: |- | ||
BASE_IMAGE=mcdreforged/mcdreforged:${{ inputs.source_tag }} | ||
image_name: mcdreforged/mcdreforged-extra | ||
image_tags: ${{ inputs.source_tag }} | ||
|
||
openjdk: | ||
needs: extra | ||
strategy: | ||
matrix: | ||
java: ['8', '11', '17', '21'] | ||
distribution: ['temurin', 'zulu', 'liberica'] | ||
extra: ['false', 'true'] | ||
|
||
uses: ./.github/workflows/image_one.yml | ||
secrets: inherit | ||
with: | ||
dockerfile_name: Dockerfile-${{ matrix.distribution }} | ||
build_args: |- | ||
BASE_IMAGE=mcdreforged/${{ matrix.extra == 'true' && 'mcdreforged-extra' || 'mcdreforged' }}:${{ inputs.source_tag }} | ||
JAVA=${{ matrix.java }} | ||
image_name: mcdreforged/mcdreforged-${{ matrix.distribution }} | ||
image_tags: |- | ||
type=raw,value=${{ inputs.source_tag }},enable=${{ matrix.extra == 'false' && matrix.java == '17' }} | ||
type=raw,value=${{ inputs.source_tag }}-extra,enable=${{ matrix.extra == 'true' && matrix.java == '17' }} | ||
type=raw,value=${{ inputs.source_tag }}-jdk${{ matrix.java }},enable=${{ matrix.extra == 'false' }} | ||
type=raw,value=${{ inputs.source_tag }}-jdk${{ matrix.java }}-extra,enable=${{ matrix.extra == 'true' }} |
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
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
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