Coder Social home page Coder Social logo

gh-setup's Introduction

gh-setup

:octocat: Setup asset of Github Releases.

build Coverage Code to Test Ratio

Key features of gh-setup are:

  • For setup, detect the version, the appropriate GitHub Releases asset, the asset's compressed format, and the executable path where the binary will be installed.
  • Works as a GitHub CLI extension (or a standalone CLI) as well as a GitHub Action.
  • Could be used as a part to create a GitHub Action like setup-*.

As a GitHub CLI extension

Usage

$ gh setup --repo k1LoW/tbls
Use tbls_v1.62.0_darwin_arm64.zip
Setup binaries to executable path (PATH):
  tbls -> /Users/k1low/local/bin/tbls
$ tbls version
1.62.0

Install

$ gh extension install k1LoW/gh-setup

As a GitHub Action

Usage

# .github/workflows/doc.yml
[...]
    steps:
      -
        name: Setup k1LoW/tbls
        uses: k1LoW/gh-setup@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          repo: k1LoW/tbls
        # version: v1.60.0
        # os: linux
        # arch: amd64
        # bin-match: tbls
        # force: true
        # strict: true
        # gh-setup-version: latest
      -
        name: Run tbls
        run: tbls doc

As a part to create a GitHub Action like setup-*

See https://github.com/k1LoW/setup-tbls

# action.yml
name: 'Setup tbls'
description: 'GitHub Action for tbls, a CI-Friendly tool for document a database, written in Go.'
branding:
  icon: 'box'
  color: 'blue'
inputs:
  github-token:
    description: The GitHub token
    default: ${{ github.token }}
    required: false
  version:
    description: Version of tbls
    default: latest
    required: false
  force:
    description: Enable force setup
    default: ''
    required: false
runs:
  using: 'composite'
  steps:
    -
      uses: k1LoW/gh-setup@v1
      with:
        repo: github.com/k1LoW/tbls
        github-token: ${{ inputs.github-token }}
        version: ${{ inputs.version }}
        bin-match: tbls
        force: ${{ inputs.force }}

As a Standalone CLI

Usage

Run gh-setup instead of gh setup.

$ gh-setup --repo k1LoW/tbls
Use tbls_v1.62.0_darwin_arm64.zip
Setup binaries to executable path (PATH):
  tbls -> /Users/k1low/local/bin/tbls
$ tbls version
1.62.0

Install

deb:

$ export GH_SETUP_VERSION=X.X.X
$ curl -o gh-setup.deb -L https://github.com/k1LoW/gh-setup/releases/download/v$GH_SETUP_VERSION/gh-setup_$GH_SETUP_VERSION-1_amd64.deb
$ dpkg -i gh-setup.deb

RPM:

$ export GH_SETUP_VERSION=X.X.X
$ yum install https://github.com/k1LoW/gh-setup/releases/download/v$GH_SETUP_VERSION/gh-setup_$GH_SETUP_VERSION-1_amd64.rpm

apk:

$ export GH_SETUP_VERSION=X.X.X
$ curl -o gh-setup.apk -L https://github.com/k1LoW/gh-setup/releases/download/v$GH_SETUP_VERSION/gh-setup_$GH_SETUP_VERSION-1_amd64.apk
$ apk add gh-setup.apk

homebrew tap:

$ brew install k1LoW/tap/gh-setup

aqua:

$ aqua g -i k1LoW/gh-setup

manually:

Download binary from releases page

go install:

$ go install github.com/k1LoW/gh-setup/cmd/gh-setup@latest

docker:

$ docker pull ghcr.io/k1low/gh-setup:latest

gh-setup's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar k1low avatar k2tzumi avatar suzuki-shunsuke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gh-setup's Issues

Add support for secure token storage

Token storage change in latest release of gh

This is a message from the GitHub CLI team, maintainers of gh, writing to inform you that the most recent release of gh contains changes which may affect your extension. The latest release introduces the feature of storing authentication tokens in the system keyring (encrypted storage) instead of in a plain text file.
The keyrings that are supported are:

  • Keychain on macOS

  • GNOME Keyring on Linux (Secret Service dbus interface)

  • Wincred on Windows

This has huge security benefits for the users of our tool and was one of our oldest outstanding issues. Unfortunately this change has the potential to break extensions that rely on utilizing the users authentication token to work.

In order to have continued compatibility with gh there are some actions you, as an extension author, need to take. These actions will depend on the implementation of your extension.

Extensions built in Go using go-gh:

  1. Upgrade your go-gh version to v1.2.1, the latest version.

  2. Verify that in your extension retrieval of the user authentication token is done using the auth.TokenForHost function.

    • If you were previously accessing the authentication token using any other method it will no longer work.
    • Automatic resolution of the authentication token when using the API clients will continue to work without changes.

All other extensions:

  1. Verify that in your extension retrieval of the user authentication token is done by shelling out to the gh auth token command.

    • If you were previously accessing the authentication token using the gh config get command, reading the configuration file directly, or any other methods it will no longer work.

As of right now storing the authentication token in the system keyring is an opt-in feature, but in the near future it will be required and at that point if the changes above are not made then your extension will be broken for all users. If you have any questions/concerns about this change please feel free to open a discussion in the gh repo.

Thanks,
The GitHub CLI Team

Support to run on `arm` Linux.

I am running k1LoW/octocov-action on the Linux arm runner of Github Actions, but it fails with the following error.

Run k1LoW/octocov-action@v1
Run k1LoW/gh-setup@v1
Run ${GITHUB_ACTION_PATH}/scripts/install-gh-setup.sh
/tmp/gh-setup: line 1: Not: command not found

I think the cause is that gh-setup cannot get the executable for arm64 on Linux, but is it possible to handle this?

Thank you.

Add the installation guide with aqua to the document

Hi, thank you for your great project!

We suggest to add the installation guide with aqua to the document.
aqua is a declarative CLI Version Manager.
You can install this tool with aqua.

aqua init # Create aqua.yaml
aqua g -i k1LoW/gh-setup # Add this tool to aqua.yaml
aqua i # Install tools

For the detail of aqua, please see the official document.

We expect you can just copy and paste the following guide to your document.


Install with aqua

You can install this tool with aqua.

aqua g -i k1LoW/gh-setup # Add k1LoW/gh-setup to aqua.yaml

Thank you.

This issue was created automatically by script. For the detail, please see here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.