@@ -17,41 +17,44 @@ inputs:
17
17
runs :
18
18
using : " composite"
19
19
steps :
20
- - name : Download Coder binary from access URL (Windows)
20
+ - name : Download and install Coder binary (Windows)
21
21
if : runner.os == 'Windows'
22
22
run : |
23
- curl -fsSL ${{ inputs.access_url }}/bin/coder-windows-amd64.exe -o $env:USERPROFILE\AppData\Local\bin\coder.exe
23
+ if (${{ runner.arch }} -eq "ARM64") {
24
+ $ARCH = "arm64"
25
+ } else {
26
+ $ARCH = "amd64"
27
+ }
28
+ curl -fsSL ${{ inputs.access_url }}/bin/coder-windows-$ARCH.exe -o $env:USERPROFILE\AppData\Local\bin\coder.exe
24
29
echo "$env:USERPROFILE\AppData\Local\bin" >> $GITHUB_PATH
25
30
shell : pwsh
26
31
27
- - name : Download Coder binary from access URL (Linux)
28
- if : runner.os == 'Linux '
32
+ - name : Download and install Coder binary (Linux/macOS )
33
+ if : runner.os != 'Windows '
29
34
run : |
30
- if [[ "$RUNNER_ARCH " == "ARM64" ] ]; then
35
+ if [ "${{ runner.arch }} " == "ARM64" ]; then
31
36
ARCH="arm64"
32
37
else
33
38
ARCH="amd64"
34
39
fi
35
- curl -fsSL ${{ inputs.access_url }}/bin/coder-linux-$ARCH -o $HOME/.local/bin/coder
40
+ OS=${{ runner.os | toLower }}
41
+ curl -fsSL ${{ inputs.access_url }}/bin/coder-${OS}-${ARCH} -o $HOME/.local/bin/coder
36
42
chmod +x $HOME/.local/bin/coder
37
43
echo "$HOME/.local/bin" >> $GITHUB_PATH
38
44
shell : bash
39
45
40
- - name : Download Coder binary from access URL (macOS)
41
- if : runner.os == 'macOS'
42
- run : |
43
- if [[ "$RUNNER_ARCH" == "ARM64" ]]; then
44
- ARCH="arm64"
45
- else
46
- ARCH="amd64"
47
- fi
48
- curl -fsSL ${{ inputs.access_url }}/bin/coder-darwin-$ARCH -o $HOME/.local/bin/coder
49
- chmod +x $HOME/.local/bin/coder
50
- shell : bash
46
+ - name : Login to Coder (Windows)
47
+ if : runner.os == 'Windows'
48
+ run : coder login --token $CODER_SESSION_TOKEN $CODER_URL
49
+ shell : pwsh
50
+ env :
51
+ CODER_URL : ${{ inputs.access_url }}
52
+ CODER_SESSION_TOKEN : ${{ inputs.coder_session_token }}
51
53
52
- - name : Login to Coder
53
- shell : bash
54
+ - name : Login to Coder (Linux/macOS)
55
+ if : runner.os != 'Windows'
54
56
run : coder login --token $CODER_SESSION_TOKEN $CODER_URL
57
+ shell : bash
55
58
env :
56
59
CODER_URL : ${{ inputs.access_url }}
57
- CODER_SESSION_TOKEN : ${{ inputs.coder_session_token }}
60
+ CODER_SESSION_TOKEN : ${{ inputs.coder_session_token }}
0 commit comments