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:
14
.github/workflows/main.yml
vendored
14
.github/workflows/main.yml
vendored
@@ -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]
|
||||||
|
|||||||
5
.github/workflows/package.yml
vendored
5
.github/workflows/package.yml
vendored
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user