From 2c4965ab50fa37e50c8017d11c8902bc7d135aa7 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 24 Sep 2024 11:10:17 -0700 Subject: [PATCH 1/3] Update README.md (#1) Co-authored-by: Edward Angert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ebfb964..12aabb5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Setup [Coder](https://github.com/coder/coder) -Downloads and Configures Coder. +Downloads and authenticates Coder's CLI with your Coder server. This action can be used to run authenticated Coder commands in GitHub Action workflows. ## Usage From 70cabd98d190e2386186d0c0b945274a5dc9059b Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 26 Sep 2024 16:26:07 +0500 Subject: [PATCH 2/3] chore(README.md): update access_url in README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 12aabb5..23a7ad7 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ jobs: - name: Setup Coder uses: coder/setup-action@v1 with: - access_url: 'https://dev.coder.com' + access_url: 'https://coder.example.com' coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }} ``` ## Inputs -| Name | Description | Default | -| ------------------------- | ------------------------------------------------------------------------ | ------- | -| **`access_url`** | **Required** The url of coder deployment (e.g. ). | - | -| **`coder_session_token`** | **Required** The session token of coder. | - | +| Name | Description | Default | +| ------------------------- | ----------------------------------------------------------------------------- | ------- | +| **`access_url`** | **Required** The url of coder deployment (e.g. ). | - | +| **`coder_session_token`** | **Required** The session token of coder. | - | From 4a607a8113d4e676e2d7c34caa20a814bc88bfda Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sat, 5 Oct 2024 00:29:13 -0700 Subject: [PATCH 3/3] feat: add arm64 support and use a non-root path (#4) - Introduce a GitHub Actions workflow for testing on push and PR. - Improve Coder binary setup to support both ARM64 and AMD64. - Ensure binaries are installed in local bin directory. - Update path configuration to include Coder binary location. --- .github/workflows/test.yaml | 27 +++++++++++++++++++++++++++ action.yaml | 16 +++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..53a3c15 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,27 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + arch: [amd64, arm64] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run Setup Coder Action + uses: ./ + with: + access_url: ${{ secrets.CODER_URL }} + coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }} + + - name: Run Coder CLI + run: coder whoami diff --git a/action.yaml b/action.yaml index 6a68dfc..7e43e3e 100644 --- a/action.yaml +++ b/action.yaml @@ -17,8 +17,18 @@ inputs: runs: using: "composite" steps: - - name: Download Coder binary from access URL - run: curl -fsSL $CODER_URL/bin/coder-linux-amd64 -o /usr/local/bin/coder && chmod +x /usr/local/bin/coder + - name: Download and install Coder binary + run: | + if [ "${{ runner.arch }}" == "ARM64" ]; then + ARCH="arm64" + else + ARCH="amd64" + fi + mkdir -p "$HOME"/.local/bin + curl -fsSL --compressed "$CODER_URL"/bin/coder-linux-${ARCH} -o "$HOME"/.local/bin/coder + chmod +x "$HOME"/.local/bin/coder + echo "$HOME/.local/bin" >> $GITHUB_PATH + "$HOME"/.local/bin/coder version shell: bash env: CODER_URL: ${{ inputs.access_url }} @@ -28,4 +38,4 @@ runs: shell: bash env: CODER_URL: ${{ inputs.access_url }} - CODER_SESSION_TOKEN: ${{ inputs.coder_session_token }} \ No newline at end of file + CODER_SESSION_TOKEN: ${{ inputs.coder_session_token }}