From 9c8ac09dc659be7b54d04ab19ccde6573dcf08cc Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 8 Jul 2022 13:21:53 -0400 Subject: [PATCH 1/3] feat(ci): add ci build and goreleaser --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++ .github/workflows/goreleaser.yml | 21 ++++++++++++++++++++ .github/workflows/nightly.yml | 14 +++++++++++++ .github/workflows/soft-serve.yml | 12 +++++++++++ .goreleaser.yml | 13 ++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .github/workflows/nightly.yml create mode 100644 .github/workflows/soft-serve.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0e2b2dc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + env: + GO111MODULE: "on" + steps: + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ~1.17 + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download Go modules + run: go mod download + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v -cover -timeout=30s ./... + + snapshot: + uses: charmbracelet/meta/.github/workflows/snapshot.yml@main + secrets: + goreleaser_key: ${{ secrets.GORELEASER_KEY }} \ No newline at end of file diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..a958106 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,21 @@ +name: goreleaser + +on: + push: + tags: + - v*.*.* + +concurrency: + group: goreleaser + cancel-in-progress: true + +jobs: + goreleaser: + uses: charmbracelet/meta/.github/workflows/goreleaser.yml@main + secrets: + docker_username: ${{ secrets.DOCKERHUB_USERNAME }} + docker_token: ${{ secrets.DOCKERHUB_TOKEN }} + gh_pat: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + goreleaser_key: ${{ secrets.GORELEASER_KEY }} + aur_key: ${{ secrets.AUR_KEY }} + fury_token: ${{ secrets.FURY_TOKEN }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..28f61f7 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,14 @@ +name: nightly + +on: + push: + branches: + - main + +jobs: + nightly: + uses: charmbracelet/meta/.github/workflows/nightly.yml@main + secrets: + docker_username: ${{ secrets.DOCKERHUB_USERNAME }} + docker_token: ${{ secrets.DOCKERHUB_TOKEN }} + goreleaser_key: ${{ secrets.GORELEASER_KEY }} diff --git a/.github/workflows/soft-serve.yml b/.github/workflows/soft-serve.yml new file mode 100644 index 0000000..b10a5c9 --- /dev/null +++ b/.github/workflows/soft-serve.yml @@ -0,0 +1,12 @@ +name: soft-serve + +on: + push: + branches: + - main + +jobs: + soft-serve: + uses: charmbracelet/meta/.github/workflows/soft-serve.yml@main + secrets: + ssh-key: "${{ secrets.CHARM_SOFT_SERVE_KEY }}" \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..6511a86 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,13 @@ +includes: + - from_url: + url: charmbracelet/meta/main/goreleaser.yaml + +variables: + main: "." + description: "Tasty Bubble Gum for your shell." + github_url: "https://github.com/charmbracelet/gum" + maintainer: "Maas Lalani " + brew_commit_author_name: "Maas Lalani" + brew_commit_author_email: "maas@charm.sh" + + From 7d5333deb249b871833edf934931e10ff51164e1 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 8 Jul 2022 13:31:54 -0400 Subject: [PATCH 2/3] docs: add installation methods to readme --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 2a0faa8..ce83e76 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,46 @@ The following example is running from a [single Bash script](./examples/demo.sh) Shell running the Gum examples/demo.sh script +## Installation + +Use a package manager: + +```bash +# macOS or Linux +brew tap charmbracelet/tap && brew install charmbracelet/tap/gum + +# Arch Linux +pacman -S gum + +# Nix +nix-env -iA nixpkgs.gum + +# Debian/Ubuntu +echo 'deb [trusted=yes] https://repo.charm.sh/apt/ /' | sudo tee /etc/apt/sources.list.d/charm.list +sudo apt update && sudo apt install gum + +# Fedora +echo '[charm] +name=Charm +baseurl=https://repo.charm.sh/yum/ +enabled=1 +gpgcheck=0' | sudo tee /etc/yum.repos.d/charm.repo +sudo yum install gum +``` + +Or download it: + +* [Packages][releases] are available in Debian and RPM formats +* [Binaries][releases] are available for Linux, macOS, and Windows + +Or just install it with `go`: + +```bash +go install github.com/charmbracelet/gum@latest +``` + +[releases]: https://github.com/charmbracelet/gum/releases + ## Interaction #### Input From d0325fd2f9849403b9e6cb24060fd9557d5d20cd Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 8 Jul 2022 13:37:13 -0400 Subject: [PATCH 3/3] feat: add Dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6e0e54c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM gcr.io/distroless/static +COPY gum /usr/local/bin/gum +ENTRYPOINT [ "/usr/local/bin/gum" ]