From 1f9294f34573db2c238128f5b5fd822da1435904 Mon Sep 17 00:00:00 2001 From: Emily McLean Date: Mon, 27 Oct 2025 10:18:08 +1100 Subject: [PATCH 1/4] Remove login from test workflows --- .github/workflows/src/build.pkl | 7 +++++++ .github/workflows/src/lib/base.pkl | 14 +++++--------- .github/workflows/test-full.yml | 30 ------------------------------ .github/workflows/test.yml | 30 ------------------------------ 4 files changed, 12 insertions(+), 69 deletions(-) diff --git a/.github/workflows/src/build.pkl b/.github/workflows/src/build.pkl index ec4e09a..e2b3bcd 100644 --- a/.github/workflows/src/build.pkl +++ b/.github/workflows/src/build.pkl @@ -44,6 +44,13 @@ local function docker(dir: String): Listing = } } ...base.dockerSetup() + (base.dockerBuild) { + with = new Mapping { + ["registry"] = "https://ghcr.io" + ["username"] = "${{ github.actor }}" + ["password"] = "${{ secrets.GITHUB_TOKEN }}" + } + } ...base.dockerBuild( new Mapping { ["context"] = dir diff --git a/.github/workflows/src/lib/base.pkl b/.github/workflows/src/lib/base.pkl index aa54a1e..bcb05eb 100644 --- a/.github/workflows/src/lib/base.pkl +++ b/.github/workflows/src/lib/base.pkl @@ -71,15 +71,11 @@ function dockerSetup(): Listing = new Listing { name = "Setup Docker Buildx" uses = "docker/setup-buildx-action@v3" } - new ActionStep { - name = "Log in to the Container registry" - uses = "docker/login-action@v3" - with = new Mapping { - ["registry"] = "https://ghcr.io" - ["username"] = "${{ github.actor }}" - ["password"] = "${{ secrets.GITHUB_TOKEN }}" - } - } +} + +hidden dockerBuild: ActionStep = new ActionStep { + name = "Log in to the Container registry" + uses = "docker/login-action@v3" } function renderForPlatform(platform: Platform, version: String): Listing = new Listing { diff --git a/.github/workflows/test-full.yml b/.github/workflows/test-full.yml index 3e30516..47b5e11 100644 --- a/.github/workflows/test-full.yml +++ b/.github/workflows/test-full.yml @@ -127,12 +127,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build java/ -t test/java:latest --load - name: Generate and test @@ -198,12 +192,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build kotlin/ -t test/kotlin:latest --load - name: Generate and test @@ -269,12 +257,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build doc/ -t test/doc:latest --load - name: Generate and test @@ -366,12 +348,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build swift/ --build-arg ${{ env.BUILD_ARGS }} -t test/swift:latest --load - name: Generate and test @@ -449,12 +425,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build go/ -t test/go:latest --load - name: Generate and test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2dc1db..211332d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,12 +54,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build java/ -t test/java:latest --load - name: Generate and test @@ -123,12 +117,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build kotlin/ -t test/kotlin:latest --load - name: Generate and test @@ -192,12 +180,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build doc/ -t test/doc:latest --load - name: Generate and test @@ -287,12 +269,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build swift/ --build-arg ${{ env.BUILD_ARGS }} -t test/swift:latest --load - name: Generate and test @@ -368,12 +344,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image run: docker buildx build go/ -t test/go:latest --load - name: Generate and test From 9a030253a3baec496bfb0e29c38a3a3031877862 Mon Sep 17 00:00:00 2001 From: Emily McLean Date: Mon, 27 Oct 2025 10:31:00 +1100 Subject: [PATCH 2/4] Update build for ghcr --- .github/workflows/build.yml | 120 +++++++++++++------------------- .github/workflows/src/build.pkl | 74 +++++++++----------- 2 files changed, 84 insertions(+), 110 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfe42fc..719aa2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,7 +138,7 @@ jobs: else echo "any_changed=false" >> "$GITHUB_ENV" fi - build-java: + build-java-ghcr: permissions: contents: read packages: write @@ -172,10 +172,6 @@ jobs: engine: mustache - name: Make endpoint.sh executable run: chmod +x java/entrypoint.sh - - name: Lowercase repository name - env: - REPOSITORY: ${{ github.repository }} - run: echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx @@ -194,11 +190,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }}-${{ needs.version.outputs.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }} build-args: ${{ env.BUILD_ARGS }} - name: Build and push Docker image if: github.ref != 'refs/heads/main' @@ -208,11 +204,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-java:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} - build-kotlin: + build-kotlin-ghcr: permissions: contents: read packages: write @@ -246,10 +242,6 @@ jobs: engine: mustache - name: Make endpoint.sh executable run: chmod +x kotlin/entrypoint.sh - - name: Lowercase repository name - env: - REPOSITORY: ${{ github.repository }} - run: echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx @@ -268,11 +260,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }} build-args: ${{ env.BUILD_ARGS }} - name: Build and push Docker image if: github.ref != 'refs/heads/main' @@ -282,11 +274,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} - build-doc: + build-doc-ghcr: permissions: contents: read packages: write @@ -320,10 +312,6 @@ jobs: engine: mustache - name: Make endpoint.sh executable run: chmod +x doc/entrypoint.sh - - name: Lowercase repository name - env: - REPOSITORY: ${{ github.repository }} - run: echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx @@ -342,11 +330,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }}-${{ needs.version.outputs.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }} build-args: ${{ env.BUILD_ARGS }} - name: Build and push Docker image if: github.ref != 'refs/heads/main' @@ -356,11 +344,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-doc:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} - build-swift: + build-swift-ghcr: permissions: contents: read packages: write @@ -420,10 +408,6 @@ jobs: } echo "BUILD_ARGS=$(verlt ${{ matrix.version }} 0.29.0 && echo "SWIFT_VERSION=5.10" || echo "SWIFT_VERSION=6.1.3")" >> $GITHUB_ENV - - name: Lowercase repository name - env: - REPOSITORY: ${{ github.repository }} - run: echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx @@ -442,11 +426,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }}-${{ needs.version.outputs.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }} build-args: ${{ env.BUILD_ARGS }} - name: Build and push Docker image if: github.ref != 'refs/heads/main' @@ -456,11 +440,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-swift:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} - build-go: + build-go-ghcr: permissions: contents: read packages: write @@ -506,10 +490,6 @@ jobs: engine: mustache - name: Make setup.sh executable run: chmod +x go/setup.sh - - name: Lowercase repository name - env: - REPOSITORY: ${{ github.repository }} - run: echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} - name: Setup QEMU uses: docker/setup-qemu-action@v3 - name: Setup Docker Buildx @@ -528,11 +508,11 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }}-${{ needs.version.outputs.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }} build-args: ${{ env.BUILD_ARGS }} - name: Build and push Docker image if: github.ref != 'refs/heads/main' @@ -542,17 +522,17 @@ jobs: platforms: linux/amd64,linux/arm64/v8 push: true tags: |- - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-go:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} update-pkl-actions: needs: - - build-java - - build-kotlin - - build-doc - - build-swift - - build-go + - build-java-ghcr + - build-kotlin-ghcr + - build-doc-ghcr + - build-swift-ghcr + - build-go-ghcr if: github.ref == 'refs/heads/main' && github.repository_owner == 'emilymclean' runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/src/build.pkl b/.github/workflows/src/build.pkl index e2b3bcd..7de59af 100644 --- a/.github/workflows/src/build.pkl +++ b/.github/workflows/src/build.pkl @@ -13,55 +13,34 @@ local dockerPermissions = new Mapping { ["packages"] = "write" } -local function buildJob(dir: String): Job = new Job { +local function baseBuildJob(platform: String, login: Step, reference: String): Job = new Job { needs = new Listing { "version" "pkl-versions" - "was-updated-\(dir)" + "was-updated-\(platform)" } - `if` = "needs.was-updated-\(dir).outputs.any-changed == 'true'" + `if` = "needs.was-updated-\(platform).outputs.any-changed == 'true'" strategy = new JobStrategy { matrix = "${{fromJson(needs.pkl-versions.outputs.versions)}}" } permissions = dockerPermissions steps = new Listing { base.checkout - ...base.renderForPlatform(dir, "${{ matrix.version }}") - ...docker(dir) - } -} - -local function docker(dir: String): Listing = - new Listing { - ...base.buildArgsForPlatform(dir, "${{ matrix.version }}") - new CommandStep { - name = "Lowercase repository name" - run = """ - echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} - """ - env = new Mapping { - ["REPOSITORY"] = "${{ github.repository }}" - } - } + ...base.renderForPlatform(platform, "${{ matrix.version }}") + ...base.buildArgsForPlatform(platform, "${{ matrix.version }}") ...base.dockerSetup() - (base.dockerBuild) { - with = new Mapping { - ["registry"] = "https://ghcr.io" - ["username"] = "${{ github.actor }}" - ["password"] = "${{ secrets.GITHUB_TOKEN }}" - } - } + login ...base.dockerBuild( new Mapping { - ["context"] = dir + ["context"] = platform ["platforms"] = "linux/amd64,linux/arm64/v8" ["push"] = true ["tags"] = """ - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }}-${{ needs.version.outputs.version }} - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }}-${{ needs.version.outputs.major }} + \(reference):${{ matrix.version }} + \(reference):${{ matrix.version }}-nightly + \(reference):${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + \(reference):${{ matrix.version }}-${{ needs.version.outputs.version }} + \(reference):${{ matrix.version }}-${{ needs.version.outputs.major }} """ ["build-args"] = "${{ env.BUILD_ARGS }}" }, @@ -69,19 +48,34 @@ local function docker(dir: String): Listing = ) ...base.dockerBuild( new Mapping { - ["context"] = dir + ["context"] = platform ["platforms"] = "linux/amd64,linux/arm64/v8" ["push"] = true ["tags"] = """ - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly - ghcr.io/${{ env.REPOSITORY_LC }}-\(dir):${{ matrix.version }}-${{ needs.version.outputs.version }} + \(reference):${{ matrix.version }}-nightly + \(reference):${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + \(reference):${{ matrix.version }}-${{ needs.version.outputs.version }} """ ["build-args"] = "${{ env.BUILD_ARGS }}" }, "github.ref != 'refs/heads/main'" ) - } + } +} + +local function buildJob(platform: String): Mapping = new Mapping { + ["build-\(platform)-ghcr"] = baseBuildJob( + platform, + (base.dockerBuild) { + with = new Mapping { + ["registry"] = "https://ghcr.io" + ["username"] = "${{ github.actor }}" + ["password"] = "${{ secrets.GITHUB_TOKEN }}" + } + }, + "${{ vars.LOCAL_DOCKER_REFERENCE }}-\(platform)" + ) +} name = "Build Java, Kotlin, Swift, and PklDoc Docker images" @@ -167,13 +161,13 @@ jobs = new Mapping { ["was-updated-\(platform)"] = base.wasUpdated(platform) } for (platform in base.PLATFORMS) { - ["build-\(platform)"] = buildJob(platform) + ...buildJob(platform) } ["update-pkl-actions"] = new Job { `if` = "github.ref == 'refs/heads/main' && github.repository_owner == 'emilymclean'" needs = new Listing { for (platform in base.PLATFORMS) { - "build-\(platform)" + "build-\(platform)-ghcr" } } strategy = new JobStrategy { From fbae053bc2438a8d6b638aae5a4e75143290dc09 Mon Sep 17 00:00:00 2001 From: Emily McLean Date: Mon, 27 Oct 2025 10:31:15 +1100 Subject: [PATCH 3/4] Add dockerio build and push --- .github/workflows/build.yml | 383 ++++++++++++++++++++++++++++++++ .github/workflows/src/build.pkl | 10 + 2 files changed, 393 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 719aa2e..bb2b927 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -208,6 +208,75 @@ jobs: ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly ${{ vars.LOCAL_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} + build-java-dockerio: + permissions: + contents: read + packages: write + needs: + - version + - pkl-versions + - was-updated-java + if: needs.was-updated-java.outputs.any-changed == 'true' + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJson(needs.pkl-versions.outputs.versions)}} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Render build.template.gradle + env: + pkl_version: ${{ matrix.version }} + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: java/project/build.template.gradle + output-file: java/project/build.gradle + engine: mustache + - name: Render endpoint.sh + env: + call: java -cp /pklgen.jar org.pkl.codegen.java.Main + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: templates/entrypoint.template.sh + output-file: java/entrypoint.sh + engine: mustache + - name: Make endpoint.sh executable + run: chmod +x java/entrypoint.sh + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PAT }} + - name: Build and push Docker image + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: java + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }} + build-args: ${{ env.BUILD_ARGS }} + - name: Build and push Docker image + if: github.ref != 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: java + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-java:${{ matrix.version }}-${{ needs.version.outputs.version }} + build-args: ${{ env.BUILD_ARGS }} build-kotlin-ghcr: permissions: contents: read @@ -278,6 +347,75 @@ jobs: ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly ${{ vars.LOCAL_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} + build-kotlin-dockerio: + permissions: + contents: read + packages: write + needs: + - version + - pkl-versions + - was-updated-kotlin + if: needs.was-updated-kotlin.outputs.any-changed == 'true' + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJson(needs.pkl-versions.outputs.versions)}} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Render build.template.gradle + env: + pkl_version: ${{ matrix.version }} + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: kotlin/project/build.template.gradle + output-file: kotlin/project/build.gradle + engine: mustache + - name: Render endpoint.sh + env: + call: java -cp /pklgen.jar org.pkl.codegen.kotlin.Main + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: templates/entrypoint.template.sh + output-file: kotlin/entrypoint.sh + engine: mustache + - name: Make endpoint.sh executable + run: chmod +x kotlin/entrypoint.sh + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PAT }} + - name: Build and push Docker image + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: kotlin + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }} + build-args: ${{ env.BUILD_ARGS }} + - name: Build and push Docker image + if: github.ref != 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: kotlin + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-kotlin:${{ matrix.version }}-${{ needs.version.outputs.version }} + build-args: ${{ env.BUILD_ARGS }} build-doc-ghcr: permissions: contents: read @@ -348,6 +486,75 @@ jobs: ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly ${{ vars.LOCAL_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} + build-doc-dockerio: + permissions: + contents: read + packages: write + needs: + - version + - pkl-versions + - was-updated-doc + if: needs.was-updated-doc.outputs.any-changed == 'true' + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJson(needs.pkl-versions.outputs.versions)}} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Render build.template.gradle + env: + pkl_version: ${{ matrix.version }} + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: doc/project/build.template.gradle + output-file: doc/project/build.gradle + engine: mustache + - name: Render endpoint.sh + env: + call: java -cp /pklgen.jar org.pkl.doc.Main + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: templates/entrypoint.template.sh + output-file: doc/entrypoint.sh + engine: mustache + - name: Make endpoint.sh executable + run: chmod +x doc/entrypoint.sh + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PAT }} + - name: Build and push Docker image + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: doc + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }} + build-args: ${{ env.BUILD_ARGS }} + - name: Build and push Docker image + if: github.ref != 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: doc + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-doc:${{ matrix.version }}-${{ needs.version.outputs.version }} + build-args: ${{ env.BUILD_ARGS }} build-swift-ghcr: permissions: contents: read @@ -444,6 +651,101 @@ jobs: ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly ${{ vars.LOCAL_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} + build-swift-dockerio: + permissions: + contents: read + packages: write + needs: + - version + - pkl-versions + - was-updated-swift + if: needs.was-updated-swift.outputs.any-changed == 'true' + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJson(needs.pkl-versions.outputs.versions)}} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Read swift-tool-version + run: |- + verlte() { + [ "$1" = "`echo -e "$1 + $2" | sort -V | head -n1`" ] + } + + verlt() { + [ "$1" = "$2" ] && return 1 || verlte $1 $2 + } + + echo "swift_tool_version=$(verlt ${{ matrix.version }} 0.29.0 && echo "0.4.2" || cat swift/swift-tool-version)" >> $GITHUB_ENV + - name: Render setup.template.sh + env: + pkl_version: ${{ matrix.version }} + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: swift/setup.template.sh + output-file: swift/setup.sh + engine: mustache + - name: Make setup.sh executable + run: chmod +x swift/setup.sh + - name: Render endpoint.sh + env: + call: LD_LIBRARY_PATH=/usr/share/swift/usr/lib/swift/linux PATH=$PATH:/usr/share/swift/usr/bin/ /pkl-gen-swift + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: templates/entrypoint.template.sh + output-file: swift/entrypoint.sh + engine: mustache + - name: Make endpoint.sh executable + run: chmod +x swift/entrypoint.sh + - name: Set swift image version + run: |- + verlte() { + [ "$1" = "`echo -e "$1 + $2" | sort -V | head -n1`" ] + } + + verlt() { + [ "$1" = "$2" ] && return 1 || verlte $1 $2 + } + + echo "BUILD_ARGS=$(verlt ${{ matrix.version }} 0.29.0 && echo "SWIFT_VERSION=5.10" || echo "SWIFT_VERSION=6.1.3")" >> $GITHUB_ENV + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PAT }} + - name: Build and push Docker image + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: swift + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }} + build-args: ${{ env.BUILD_ARGS }} + - name: Build and push Docker image + if: github.ref != 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: swift + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-swift:${{ matrix.version }}-${{ needs.version.outputs.version }} + build-args: ${{ env.BUILD_ARGS }} build-go-ghcr: permissions: contents: read @@ -526,6 +828,87 @@ jobs: ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly ${{ vars.LOCAL_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.version }} build-args: ${{ env.BUILD_ARGS }} + build-go-dockerio: + permissions: + contents: read + packages: write + needs: + - version + - pkl-versions + - was-updated-go + if: needs.was-updated-go.outputs.any-changed == 'true' + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJson(needs.pkl-versions.outputs.versions)}} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Read go-tool-version + run: |- + verlte() { + [ "$1" = "`echo -e "$1 + $2" | sort -V | head -n1`" ] + } + + verlt() { + [ "$1" = "$2" ] && return 1 || verlte $1 $2 + } + + echo "go_tool_version=$(verlt ${{ matrix.version }} 0.29.0 && echo "0.10.0" || cat go/go-tool-version)" >> $GITHUB_ENV + - name: Render template.Dockerfile + env: + pkl_version: ${{ matrix.version }} + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: go/template.Dockerfile + output-file: go/Dockerfile + engine: mustache + - name: Render setup.template.sh + env: + pkl_version: ${{ matrix.version }} + uses: emilymclean/template-render-action@v1.0.2 + with: + template-file: go/setup.template.sh + output-file: go/setup.sh + engine: mustache + - name: Make setup.sh executable + run: chmod +x go/setup.sh + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PAT }} + - name: Build and push Docker image + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: go + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.version }} + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }} + build-args: ${{ env.BUILD_ARGS }} + - name: Build and push Docker image + if: github.ref != 'refs/heads/main' + uses: docker/build-push-action@v6 + with: + context: go + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: |- + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.major }}-nightly + ${{ vars.DOCKER_DOCKER_REFERENCE }}-go:${{ matrix.version }}-${{ needs.version.outputs.version }} + build-args: ${{ env.BUILD_ARGS }} update-pkl-actions: needs: - build-java-ghcr diff --git a/.github/workflows/src/build.pkl b/.github/workflows/src/build.pkl index 7de59af..1eec0e0 100644 --- a/.github/workflows/src/build.pkl +++ b/.github/workflows/src/build.pkl @@ -75,6 +75,16 @@ local function buildJob(platform: String): Mapping = new Mapping { }, "${{ vars.LOCAL_DOCKER_REFERENCE }}-\(platform)" ) + ["build-\(platform)-dockerio"] = baseBuildJob( + platform, + (base.dockerBuild) { + with = new Mapping { + ["username"] = "${{ vars.DOCKER_USERNAME }}" + ["password"] = "${{ secrets.DOCKER_PAT }}" + } + }, + "${{ vars.DOCKER_DOCKER_REFERENCE }}-\(platform)" + ) } name = "Build Java, Kotlin, Swift, and PklDoc Docker images" From b124f62d6c4be6400dcd65cc2a1258be0de8a35f Mon Sep 17 00:00:00 2001 From: Emily McLean Date: Mon, 27 Oct 2025 10:41:37 +1100 Subject: [PATCH 4/4] Build all when build.yml updated --- .github/workflows/build.yml | 10 +++++----- .github/workflows/src/lib/base.pkl | 2 +- .github/workflows/test-full.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb2b927..168b8cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(java/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(java/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -91,7 +91,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(kotlin/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(kotlin/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -105,7 +105,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(doc/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(doc/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -119,7 +119,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(swift/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(swift/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -133,7 +133,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(go/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(go/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" diff --git a/.github/workflows/src/lib/base.pkl b/.github/workflows/src/lib/base.pkl index bcb05eb..0e89091 100644 --- a/.github/workflows/src/lib/base.pkl +++ b/.github/workflows/src/lib/base.pkl @@ -281,7 +281,7 @@ function wasUpdated(dir: String): Job = new Job { checkout new CommandStep { run = """ - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(\(dir)/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(\(dir)/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" diff --git a/.github/workflows/test-full.yml b/.github/workflows/test-full.yml index 47b5e11..9bcafab 100644 --- a/.github/workflows/test-full.yml +++ b/.github/workflows/test-full.yml @@ -28,7 +28,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(java/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(java/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -42,7 +42,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(kotlin/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(kotlin/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -56,7 +56,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(doc/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(doc/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -70,7 +70,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(swift/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(swift/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV" @@ -84,7 +84,7 @@ jobs: with: fetch-depth: 0 - run: |- - if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(go/.*|templates/entrypoint.template.sh|pkl-versions)'; then + if git diff --no-commit-id --name-only HEAD HEAD~1 | grep -Eq '(go/.*|templates/entrypoint.template.sh|pkl-versions|.github/workflows/build.yml)'; then echo "any_changed=true" >> "$GITHUB_ENV" else echo "any_changed=false" >> "$GITHUB_ENV"