From da46bc2c0fa5e4756b51d93540fb655082716684 Mon Sep 17 00:00:00 2001 From: Leo Palmer Date: Fri, 16 Feb 2024 10:25:08 +0100 Subject: [PATCH] Add install instructions and releases --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++ .goreleaser.yaml | 46 +++++++++++++++++++++++++++++++++++++ README.md | 7 ++++++ 3 files changed, 92 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d3b5c13 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: goreleaser + +on: + push: + branches: + - 'main' + tags: + - 'v*' + pull_request: + +permissions: + contents: write + id-token: write + packages: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.21' + cache: true + - run: go mod tidy + - run: go test -v ./... + - name: Install Cosign + uses: sigstore/cosign-installer@v3.3.0 + - uses: goreleaser/goreleaser-action@v4 + if: success() && startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..35d81ae --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,46 @@ +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of uname. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-dev" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +signs: + - cmd: cosign + signature: "${artifact}.sig" + certificate: "${artifact}.pem" + env: + - COSIGN_EXPERIMENTAL=1 + args: + - sign-blob + - "-y" + - "--oidc-issuer=https://token.actions.githubusercontent.com" + - "--output-signature=${signature}" + - "--output-certificate=${certificate}" + - "${artifact}" + artifacts: all \ No newline at end of file diff --git a/README.md b/README.md index d59867e..968edcb 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ Tiny command-line tool for creating JIRA tickets with a summary/title and optionally a description. +## Installation +If you have go install locally, compile and install with: +```bash +go install github.com/leosunmo/jt/cmd/jt +``` +Otherwise download a release from the [releases page](https://github.com/leosunmo/jt/releases) and put it in your path. + ## Usage Create a config file under `~/.config/jt/config.yaml` with some default values. Here's an example with all supported values: ```yaml