From c68eed79f901d1b33fd843acf4c1fb10c0e87f6b Mon Sep 17 00:00:00 2001 From: youben11 Date: Wed, 5 Apr 2023 12:03:03 +0100 Subject: [PATCH] fix(ci): use user_input as simple string json need special escaping, and its actually a single input for now --- .github/workflows/concrete_python_release.yml | 14 ++++++++++++-- .github/workflows/main.yml | 4 ++-- .github/workflows/start_slab.yml | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/concrete_python_release.yml b/.github/workflows/concrete_python_release.yml index af729d559..9ba5272be 100644 --- a/.github/workflows/concrete_python_release.yml +++ b/.github/workflows/concrete_python_release.yml @@ -18,6 +18,7 @@ on: description: 'Slab request ID' type: string user_inputs: + description: 'either "nightly" or "public" to specify the release type' required: true type: string @@ -50,7 +51,7 @@ jobs: - name: Set up GitHub environment run: | - echo "RELEASE_TYPE=${{ fromJSON(inputs.user_inputs).release_type }}" >> "${GITHUB_ENV}" + echo "RELEASE_TYPE=${{ inputs.user_inputs }}" >> "${GITHUB_ENV}" echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}" #echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK)" >> "${GITHUB_ENV}" echo "SSH_AUTH_SOCK_DIR=$(dirname $SSH_AUTH_SOCK)" >> "${GITHUB_ENV}" @@ -175,9 +176,18 @@ jobs: toolchain: nightly override: true - - name: Set release version + - name: Set up GitHub environment + run: | + echo "RELEASE_TYPE=${{ inputs.user_inputs }}" >> "${GITHUB_ENV}" + + - name: Set release version (nightly) + if: ${{ env.RELEASE_TYPE == "nightly" }} run: echo "__version__ = \"$(date +"%Y.%m.%d")\"" >| frontends/concrete-python/version.txt + - name: Set release version (public) + if: ${{ env.RELEASE_TYPE == "public" }} + run: echo "__version__ = \"`git describe --tags --abbrev=0 | grep -e '[0-9].*' -o`\"" >| frontends/concrete-python/version.txt + - name: Create build directory run: mkdir build diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d630bb74f..c7a0b0617 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -261,7 +261,7 @@ jobs: secrets: inherit with: command: concrete-python-release - user_inputs: '{"release_type": "nightly"}' + user_inputs: 'nightly' concrete-python-public-release: if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') @@ -269,4 +269,4 @@ jobs: secrets: inherit with: command: concrete-python-release - user_inputs: '{"release_type": "public"}' + user_inputs: 'public' diff --git a/.github/workflows/start_slab.yml b/.github/workflows/start_slab.yml index 9f49dd3a5..dbfbefb06 100644 --- a/.github/workflows/start_slab.yml +++ b/.github/workflows/start_slab.yml @@ -16,6 +16,7 @@ on: required: true type: string user_inputs: + description: 'user inputs to be forwarded to the called workflow' required: false type: string