From 948eed5665c1f81459a0a6e09bdc5c4df330b4fb Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Wed, 7 Feb 2024 13:10:38 +0100 Subject: [PATCH] Allow to override a branch. (#37) --- .github/workflows/build.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39e1cf6..4181d7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,11 @@ on: description: Toit SDK version to check out required: true type: string + branch: + description: Branch to check out (overrides toit-version) + required: false + type: string + default: "" upload-release: description: Upload release artifacts required: true @@ -85,9 +90,20 @@ jobs: cmake --version gcc --version + - name: Set the git version + run: | + echo "TOIT_GIT_VERSION=${{ github.event.inputs.toit-version }}" >> $GITHUB_ENV + - name: Fetch the Toit repository run: | - make TOIT_VERSION=${{ github.event.inputs.toit-version }} download-toit + # We allow the workflow dispatch to override the checked out branch. + # Note that we set the TOIT_GIT_VERSION env variable. The checked out branch + # thus doesn't influence the version of the SDK we build. + REF=${{ github.event.inputs.branch }} + if [[ -z "$REF" ]]; then + REF=${{ github.event.inputs.toit-version }} + fi + make TOIT_VERSION=$REF download-toit - name: Ccache stats before SDK build run: |