-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
32 lines (32 loc) · 1.04 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: 'setup-cue'
description: 'Sets up an environment with CUE'
inputs:
version:
description: 'cue version, must be an exact version not a range or pattern'
required: true
github-token:
description: 'GitHub Token to use when downloading GitHub releases'
required: true
outputs:
bin:
description: 'path to cue binary'
value: ${{ steps.download.outputs.bin }}
runs:
using: "composite"
steps:
- id: download
shell: bash
env:
GITHUB_TOKEN: "${{ inputs.github-token }}"
run: |-
CUE_BIN_DIR="${{ runner.tool_cache }}/cue/${{ inputs.version }}/bin"
gh release download \
-D ${{ runner.temp }} \
-R cue-lang/cue \
-p "cue_${{ inputs.version }}_${RUNNER_OS}_x86_64.tar.gz" \
-p "cue_v${{ inputs.version }}_${RUNNER_OS,,}_amd64.tar.gz" \
v${{ inputs.version }}
mkdir -p "${CUE_BIN_DIR}"
tar xzf ${{ runner.temp }}/cue*.tar.gz -C "${CUE_BIN_DIR}" cue
echo "::set-output name=bin::${CUE_BIN_DIR}/cue"
echo "${CUE_BIN_DIR}" >> "${GITHUB_PATH}"