fill in default ,values when run from cron

Contribute to CURA-10866
This commit is contained in:
jellespijker 2023-09-12 22:57:02 +02:00
parent b75e8fd516
commit 1d4e5f5c30

View File

@ -41,10 +41,32 @@ env:
STAGING: ${{ inputs.staging || false }} STAGING: ${{ inputs.staging || false }}
jobs: jobs:
default-values:
runs-on: ubuntu-latest
outputs:
cura_conan_version: ${{ steps.default.outputs.cura_conan_version }}
steps:
- name: Output default values
id: default
shell: python
run: |
import os
cura_conan_version = "cura/latest@ultimaker/testing" if "${{ github.event.inputs.cura_conan_version }}" == "" else "${{ github.event.inputs.cura_conan_version }}"
output_env = os.environ["GITHUB_OUTPUT"]
content = ""
if os.path.exists(output_env):
with open(output_env, "r") as f:
content = f.read()
with open(output_env, "w") as f:
f.write(content)
f.writelines(f"cura_conan_version={cura_conan_version}\n")
windows-installer: windows-installer:
uses: ./.github/workflows/windows.yml uses: ./.github/workflows/windows.yml
needs: [ default-values ]
with: with:
cura_conan_version: ${{ github.event.inputs.cura_conan_version }} cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
conan_args: ${{ github.event.inputs.conan_args }} conan_args: ${{ github.event.inputs.conan_args }}
enterprise: ${{ github.event.inputs.enterprise == 'true' }} enterprise: ${{ github.event.inputs.enterprise == 'true' }}
staging: ${{ github.event.inputs.staging == 'true' }} staging: ${{ github.event.inputs.staging == 'true' }}
@ -54,8 +76,9 @@ jobs:
linux-installer: linux-installer:
uses: ./.github/workflows/linux.yml uses: ./.github/workflows/linux.yml
needs: [ default-values ]
with: with:
cura_conan_version: ${{ github.event.inputs.cura_conan_version }} cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
conan_args: ${{ github.event.inputs.conan_args }} conan_args: ${{ github.event.inputs.conan_args }}
enterprise: ${{ github.event.inputs.enterprise == 'true' }} enterprise: ${{ github.event.inputs.enterprise == 'true' }}
staging: ${{ github.event.inputs.staging == 'true' }} staging: ${{ github.event.inputs.staging == 'true' }}
@ -65,8 +88,9 @@ jobs:
macos-installer: macos-installer:
uses: ./.github/workflows/macos.yml uses: ./.github/workflows/macos.yml
needs: [ default-values ]
with: with:
cura_conan_version: ${{ github.event.inputs.cura_conan_version }} cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
conan_args: ${{ github.event.inputs.conan_args }} conan_args: ${{ github.event.inputs.conan_args }}
enterprise: ${{ github.event.inputs.enterprise == 'true' }} enterprise: ${{ github.event.inputs.enterprise == 'true' }}
staging: ${{ github.event.inputs.staging == 'true' }} staging: ${{ github.event.inputs.staging == 'true' }}
@ -75,9 +99,9 @@ jobs:
secrets: inherit secrets: inherit
# macos-arm-installer: # macos-arm-installer:
# uses: ./.github/workflows/macos.yml # needs: [ default-values ]
# with: # with:
# cura_conan_version: ${{ github.event.inputs.cura_conan_version }} # cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
# conan_args: ${{ github.event.inputs.conan_args }} # conan_args: ${{ github.event.inputs.conan_args }}
# enterprise: ${{ github.event.inputs.enterprise == 'true' }} # enterprise: ${{ github.event.inputs.enterprise == 'true' }}
# staging: ${{ github.event.inputs.staging == 'true' }} # staging: ${{ github.event.inputs.staging == 'true' }}