Skip to content

Commit

Permalink
chore: add release GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
dhth committed Mar 12, 2024
1 parent df0f475 commit 27b49fd
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.0'
- name: Build
run: go build -v ./...
- name: Install Cosign
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v2.2.3'
- name: Store Cosign private key in a file
run: 'echo "$COSIGN_KEY" > cosign.key'
shell: bash
env:
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
- name: Release Binaries
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{secrets.GH_PAT}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
43 changes: 43 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 1

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin

signs:
- cmd: cosign
stdin: "{{ .Env.COSIGN_PASSWORD }}"
args:
- "sign-blob"
- "--key=cosign.key"
- "--output-signature=${signature}"
- "${artifact}"
- "--yes" # needed on cosign 2.0.0+
artifacts: all


brews:
- name: punchout
repository:
owner: dhth
name: homebrew-tap
folder: Formula
license: MIT
homepage: "https://github.com/dhth/punchout"
description: "punchout takes the suck out of logging time on JIRA"

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,73 @@

`punchout` takes the suck out of logging time on JIRA.

<p align="center">
<img src="./punchout.gif?raw=true" alt="Usage" />
</p>

Install
---

**homebrew**:

```sh
brew install dhth/tap/punchout
```

**go**:

```sh
go install github.com/dhth/punchout@latest
```

⚡️ Usage
---

`punchout` can receive its configuration via command line flags, or a config
file.

### Using a config file

Create a toml file that looks like the following. The default location for this
file is `~/.config/punchout/punchout.toml`.

```toml
db_path = "/path/to/punchout/db/file.db"

[jira]
jira_url = "https://jira.company.com"
jira_token = "XXX"
# put whatever JQL you want to query for
jql = "assignee = currentUser() AND updatedDate >= -14d ORDER BY updatedDate DESC"
# I don't know how many people will find use for this.
# I need this, since the JIRA server I use runs 5 hours behind
# the actual time, for whatever reason 🤷
jira_time_delta_mins = 300
```

### Using command line flags

Use `punchout -h` for help.

```bash
punchout \
db-path='/path/to/punchout/db/file.db' \
jira-url='https://jira.company.com' \
jira-token='XXX' \
jql='assignee = currentUser() AND updatedDate >= -14d ORDER BY updatedDate DESC' \
jira-time-delta-mins='300' \
```

Both the config file and the command line flags can be used in conjunction, but
the latter will take precedence over the former.

```bash
punchout \
config-file-path='/path/to/punchout/config/file.toml' \
jira-token='XXX' \
jql='assignee = currentUser() AND updatedDate >= -14d ORDER BY updatedDate DESC'
```

Acknowledgements
---

Expand Down
Binary file added punchout.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 27b49fd

Please sign in to comment.