ci: Pass package build condition as workflow arg.

ci: Add defaults for init matrix; branch conditions for pulls.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-06-26 22:27:30 +00:00
parent c8ab1713c3
commit 9496d05cd2
2 changed files with 14 additions and 5 deletions

View File

@@ -38,18 +38,21 @@ jobs:
sys_targets: ${{vars.SYS_TARGETS || env.default_sys_targets}} sys_targets: ${{vars.SYS_TARGETS || env.default_sys_targets}}
sys_versions: ${{vars.SYS_VERSIONS || env.default_sys_versions}} sys_versions: ${{vars.SYS_VERSIONS || env.default_sys_versions}}
machines: ${{vars.MACHINES || env.default_machines}} machines: ${{vars.MACHINES || env.default_machines}}
release_url: ${{steps.release.outputs.upload_url}} package: ${{vars.PACKAGE || !contains(github.ref, 'refs/pull/')}}
publish: ${{vars.PUBLISH || !contains(github.ref, 'refs/pull/')}}
build_pkgs: ${{vars.BUILD_PKGS || github.ref == 'refs/heads/main' || contains(github.ref, 'tags/v')}}
check_pkgs: ${{vars.CHECK_PKGS || 'false'}} check_pkgs: ${{vars.CHECK_PKGS || 'false'}}
complement: ${{vars.COMPLEMENT || 'true'}} complement: ${{vars.COMPLEMENT || 'true'}}
complement_runner: 'het' complement_runner: 'het'
docker_repo: ${{vars.DOCKER_REPO}} docker_repo: ${{vars.DOCKER_REPO}}
release_url: ${{steps.release.outputs.upload_url}}
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
runner: ${{fromJSON(vars.RUNNERS)}} runner: ${{fromJSON(vars.RUNNERS || '["het"]')}}
machine: ${{fromJSON(vars.MACHINES)}} machine: ${{fromJSON(vars.MACHINES || '["X64"]')}}
exclude: ${{fromJSON(vars.RUNNERS_EXCLUDES)}} exclude: ${{fromJSON(vars.RUNNERS_EXCLUDES || '[]')}}
steps: steps:
- name: Initialize Builder - name: Initialize Builder
@@ -202,6 +205,7 @@ jobs:
package: package:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& needs.init.outputs.package
name: Package name: Package
needs: [init, lint] needs: [init, lint]
@@ -209,6 +213,7 @@ jobs:
with: with:
release_url: ${{needs.init.outputs.release_url}} release_url: ${{needs.init.outputs.release_url}}
check_pkgs: ${{needs.init.outputs.check_pkgs}} check_pkgs: ${{needs.init.outputs.check_pkgs}}
build_pkgs: ${{needs.init.outputs.build_pkgs}}
cargo_profiles: ${{needs.init.outputs.cargo_profiles}} cargo_profiles: ${{needs.init.outputs.cargo_profiles}}
feat_sets: ${{needs.init.outputs.feat_sets}} feat_sets: ${{needs.init.outputs.feat_sets}}
rust_toolchains: ${{needs.init.outputs.rust_toolchains}} rust_toolchains: ${{needs.init.outputs.rust_toolchains}}
@@ -249,6 +254,7 @@ jobs:
publish: publish:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& needs.init.outputs.publish
name: Publish name: Publish
needs: [init, test, package] needs: [init, test, package]

View File

@@ -38,6 +38,9 @@ on:
release_url: release_url:
type: string type: string
description: For release assets description: For release assets
build_pkgs:
type: string
default: 'true'
check_pkgs: check_pkgs:
type: string type: string
default: 'false' default: 'false'
@@ -147,7 +150,7 @@ jobs:
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v')) && fromJSON(inputs.build_pkgs)
name: Distro Packages name: Distro Packages
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml