@@ -23,6 +23,10 @@ inputs:
2323 description : If true, skip authenticating to GitHub Container Registry
2424 required : false
2525 default : " false"
26+ skip_kcl :
27+ description : If true, skips installing KCL CLI if the provider is configured
28+ required : false
29+ default : " false"
2630 skip_timoni :
2731 description : If true, skips installing Timoni CLI if the provider is configured
2832 required : false
@@ -225,4 +229,43 @@ runs:
225229226230 if : steps.cue.outputs.install && steps.cue.conclusion == 'success'
227231 with :
228- version : v${{ steps.cue.outputs.version }}
232+ version : v${{ steps.cue.outputs.version }}
233+
234+ # KCL Provider
235+ - name : Get KCL provider configuration
236+ id : kcl
237+ if : inputs.skip_kcl == 'false'
238+ shell : bash
239+ run : |
240+ echo "==== KCL Setup ====="
241+ BP=$(forge dump .)
242+
243+ KCL=$(echo "$BP" | jq -r .global.ci.providers.kcl.install)
244+ if [[ "$KCL" == "true" ]]; then
245+ INSTALL=1
246+ VERSION=$(echo "$BP" | jq -r .global.ci.providers.kcl.version)
247+ echo "install=$INSTALL" >> $GITHUB_OUTPUT
248+ echo "version=$VERSION" >> $GITHUB_OUTPUT
249+ else
250+ echo "Not installing KCL CLI"
251+ fi
252+ - name : Cache KCL
253+ id : cache-kcl
254+ if : steps.kcl.outputs.install && steps.kcl.conclusion == 'success'
255+ uses : actions/cache@v4
256+ with :
257+ path : /usr/local/bin/kcl
258+ key : ${{ runner.os }}-kcl-${{ steps.kcl.outputs.version }}
259+ - name : Install KCL
260+ if : steps.cache-kcl.outputs.cache-hit == false
261+ shell : bash
262+ run : |
263+ WORKDIR="$(mktemp -d)"
264+ VERSION="${{ steps.kcl.outputs.version }}"
265+ curl -Lo "${WORKDIR}/kcl.tar.gz" https://github.com/kcl-lang/cli/releases/download/$VERSION/kcl-$VERSION-linux-amd64.tar.gz
266+ cd "${WORKDIR}" && tar -xvzf kcl.tar.gz && mv kcl /usr/local/bin/kcl
267+ - name : Check KCL
268+ if : steps.kcl.outputs.install && steps.kcl.conclusion == 'success'
269+ shell : bash
270+ run : |
271+ kcl version
0 commit comments