Skip to content

Commit 297c4db

Browse files
committed
set binary to ctrlc
1 parent 6254a07 commit 297c4db

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.goreleaser.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ builds:
2626
tags:
2727
- containers_image_openpgp
2828
main: ./cmd/ctrlc
29+
binary: ctrlc
2930

3031
archives:
3132
- format: tar.gz
3233
# this name template makes the OS and Arch compatible with the results of `uname`.
3334
name_template: >-
34-
{{ .ProjectName }}_
35+
ctrlc_
3536
{{- title .Os }}_
3637
{{- if eq .Arch "amd64" }}x86_64
3738
{{- else if eq .Arch "386" }}i386

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CtrlC CLI
2+
3+
This is a CLI for CtrlPlane.

action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Install Go Binary
2+
description: Installs a Go binary from a GitHub repository
3+
4+
inputs:
5+
binary:
6+
description: "Name of the binary to install"
7+
required: true
8+
default: "ctrlc"
9+
version:
10+
description: "Version of the binary to install"
11+
required: true
12+
repo:
13+
description: "GitHub repository containing the binary (format: owner/repo)"
14+
required: true
15+
default: "ctrlplanedev/ctrlc"
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Download binary
20+
shell: bash
21+
run: |
22+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
23+
ARCH=$(uname -m)
24+
if [ "$ARCH" = "x86_64" ]; then
25+
ARCH="x86_64"
26+
elif [ "$ARCH" = "aarch64" ]; then
27+
ARCH="arm64"
28+
fi
29+
30+
BINARY_NAME="${{ inputs.binary }}_${OS}_${ARCH}"
31+
DOWNLOAD_URL="https://github.com/${{ inputs.repo }}/releases/download/${{ inputs.version }}/cli_${BINARY_NAME}.tar.gz"
32+
33+
curl -L $DOWNLOAD_URL -o binary.tar.gz
34+
tar xzf binary.tar.gz
35+
chmod +x ${{ inputs.binary }}
36+
sudo mv ${{ inputs.binary }} /usr/local/bin/

0 commit comments

Comments
 (0)