Skip to content

Commit

Permalink
set binary to ctrlc
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Nov 13, 2024
1 parent 6254a07 commit 297c4db
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ builds:
tags:
- containers_image_openpgp
main: ./cmd/ctrlc
binary: ctrlc

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
ctrlc_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CtrlC CLI

This is a CLI for CtrlPlane.
36 changes: 36 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Install Go Binary
description: Installs a Go binary from a GitHub repository

inputs:
binary:
description: "Name of the binary to install"
required: true
default: "ctrlc"
version:
description: "Version of the binary to install"
required: true
repo:
description: "GitHub repository containing the binary (format: owner/repo)"
required: true
default: "ctrlplanedev/ctrlc"
runs:
using: "composite"
steps:
- name: Download binary
shell: bash
run: |
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH="x86_64"
elif [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
fi
BINARY_NAME="${{ inputs.binary }}_${OS}_${ARCH}"
DOWNLOAD_URL="https://github.com/${{ inputs.repo }}/releases/download/${{ inputs.version }}/cli_${BINARY_NAME}.tar.gz"
curl -L $DOWNLOAD_URL -o binary.tar.gz
tar xzf binary.tar.gz
chmod +x ${{ inputs.binary }}
sudo mv ${{ inputs.binary }} /usr/local/bin/

0 comments on commit 297c4db

Please sign in to comment.