https://github.com/k1low/gh-setup
:octocat: Setup asset of Github releases.
https://github.com/k1low/gh-setup
gh-extension github-actions github-releases
Last synced: about 1 month ago
JSON representation
:octocat: Setup asset of Github releases.
- Host: GitHub
- URL: https://github.com/k1low/gh-setup
- Owner: k1LoW
- License: mit
- Created: 2023-02-12T09:59:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T02:40:07.000Z (11 months ago)
- Last Synced: 2025-01-31T16:52:49.873Z (10 months ago)
- Topics: gh-extension, github-actions, github-releases
- Language: Go
- Homepage:
- Size: 226 KB
- Stars: 19
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gh-setup
:octocat: Setup asset of Github Releases.
[](https://github.com/k1LoW/gh-setup/actions/workflows/ci.yml)  
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
``` console
$ 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
``` console
$ gh extension install k1LoW/gh-setup
```
## As a GitHub Action
### Usage
``` yaml
# .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
# checksum: f1ee97bbf22d5324ec2b468d83f43088d9e5c61deb77fafc220b297e03d47574
# force: true
# strict: true
# verify-attestation: true
# attestation-flags: "--owner=k1LoW"
# 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
``` yaml
# 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
checksum:
description: Checksum of tbls
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
checksum: ${{ inputs.checksum }}
force: ${{ inputs.force }}
```
## As a Standalone CLI
### Usage
Run `gh-setup` instead of `gh setup`.
``` console
$ 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:**
``` console
$ 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:**
``` console
$ 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:**
``` console
$ 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:**
```console
$ brew install k1LoW/tap/gh-setup
```
**[aqua](https://aquaproj.github.io/):**
```console
$ aqua g -i k1LoW/gh-setup
```
**manually:**
Download binary from [releases page](https://github.com/k1LoW/gh-setup/releases)
**go install:**
```console
$ go install github.com/k1LoW/gh-setup/cmd/gh-setup@latest
```
**docker:**
```console
$ docker pull ghcr.io/k1low/gh-setup:latest
```
## Attestation Verification
gh-setup supports verifying attestations using the `gh attestation verify` command. To enable attestation verification, use the `--verify-attestation` flag. You can also pass additional flags to the `gh attestation verify` command using the `--attestation-flags` flag.
Example:
```console
$ gh setup --repo k1LoW/tbls --verify-attestation --attestation-flags "--owner=k1LoW"
```
In GitHub Actions:
```yaml
- name: Setup k1LoW/tbls
uses: k1LoW/gh-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repo: k1LoW/tbls
verify-attestation: true
attestation-flags: "--owner=k1LoW"
```
This feature requires the `gh` CLI with the attestation extension to be installed.