10000 feat: support macOS, Windows and arm64 by matifali · Pull Request #3 · coder/setup-action · GitHub
[go: up one dir, main page]

Skip to content

feat: support macOS, Windows and arm64 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Consolidate Coder download and login steps
  • Loading branch information
matifali committed Oct 4, 2024
commit 097c26b72ab3d9fbe83916d310f4ade3b6e69d0f
43 changes: 23 additions & 20 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,44 @@ inputs:
runs:
using: "composite"
steps:
- name: Download Coder binary from access URL (Windows)
- name: Download and install Coder binary (Windows)
if: runner.os == 'Windows'
run: |
curl -fsSL ${{ inputs.access_url }}/bin/coder-windows-amd64.exe -o $env:USERPROFILE\AppData\Local\bin\coder.exe
if (${{ runner.arch }} -eq "ARM64") {
$ARCH = "arm64"
} else {
$ARCH = "amd64"
}
curl -fsSL ${{ inputs.access_url }}/bin/coder-windows-$ARCH.exe -o $env:USERPROFILE\AppData\Local\bin\coder.exe
echo "$env:USERPROFILE\AppData\Local\bin" >> $GITHUB_PATH
shell: pwsh

- name: Download Coder binary from access URL (Linux)
if: runner.os == 'Linux'
- name: Download and install Coder binary (Linux/macOS)
if: runner.os != 'Windows'
run: |
if [[ "$RUNNER_ARCH" == "ARM64" ]]; then
if [ "${{ runner.arch }}" == "ARM64" ]; then
ARCH="arm64"
else
ARCH="amd64"
fi
curl -fsSL ${{ inputs.access_url }}/bin/coder-linux-$ARCH -o $HOME/.local/bin/coder
OS=${{ runner.os | toLower }}
curl -fsSL ${{ inputs.access_url }}/bin/coder-${OS}-${ARCH} -o $HOME/.local/bin/coder
chmod +x $HOME/.local/bin/coder
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash

- name: Download Coder binary from access URL (macOS)
if: runner.os == 'macOS'
run: |
if [[ "$RUNNER_ARCH" == "ARM64" ]]; then
ARCH="arm64"
else
ARCH="amd64"
fi
curl -fsSL ${{ inputs.access_url }}/bin/coder-darwin-$ARCH -o $HOME/.local/bin/coder
chmod +x $HOME/.local/bin/coder
shell: bash
- name: Login to Coder (Windows)
if: runner.os == 'Windows'
run: coder login --token $CODER_SESSION_TOKEN $CODER_URL
shell: pwsh
env:
CODER_URL: ${{ inputs.access_url }}
CODER_SESSION_TOKEN: ${{ inputs.coder_session_token }}

- name: Login to Coder
shell: bash
- name: Login to Coder (Linux/macOS)
if: runner.os != 'Windows'
run: coder login --token $CODER_SESSION_TOKEN $CODER_URL
shell: bash
env:
CODER_URL: ${{ inputs.access_url }}
CODER_SESSION_TOKEN: ${{ inputs.coder_session_token }}
CODER_SESSION_TOKEN: ${{ inputs.coder_session_token }}
Loading
0