Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.15
run: go tool golangci-lint run
- name: goreleaser-check
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
distribution: goreleaser
version: v2.13
args: check
run: go tool goreleaser check
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
distribution: goreleaser
version: v2.16
args: release --clean
run: go tool goreleaser release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.URLSCAN_HOMEBREW_TAP }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
- run: go test ./...
6 changes: 3 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ homebrew_casks:
# ref. https://goreleaser.com/customization/homebrew_casks/#signing-and-notarizing
hooks:
post:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/urlscan"]
install_steps: |
on_macos do
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{ .StagedPath }}/urlscan"]
end
23 changes: 8 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,26 @@ BINARY=./dist/urlscan
# setup the -ldflags option for go build
LDFLAGS=-ldflags "-X github.com/urlscan/urlscan-cli/pkg/version.Version=${VERSION}"

.PHONY: install update lint build docs clean release

install:
go mod tidy
# install dev tools
cobra-cli help 2>/dev/null 1>&2 || go install github.com/spf13/cobra-cli@latest
golangci-lint help 2>/dev/null 1>&2 || go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
goreleaser help 2>/dev/null 1>&2 || go install github.com/goreleaser/goreleaser/v2@latest
.PHONY: update lint build docs clean release all

update:
go get -u ./...
go get -u
go mod tidy

lint: install
golangci-lint run --fix
lint:
go tool golangci-lint run --fix

build: install lint
build: lint
go build ${LDFLAGS} -o ${BINARY} main.go

docs: install
docs:
rm docs/urlscan*.md
go run docutil/main.go

clean:
rm -rf ./dist

release:
goreleaser release --snapshot --clean
go tool goreleaser release --snapshot --clean

all: install build docs
all: build docs
6 changes: 3 additions & 3 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bats test
## Lint

```bash
golangci-lint run --fix
go tool golangci-lint run --fix
```

## Build
Expand All @@ -56,13 +56,13 @@ make build

```bash
# build binaries for releasing (without publishing)
goreleaser release --snapshot --clean
go tool goreleaser release --snapshot --clean
```

## Adding a New Command

Use [cobra-cli](https://github.com/spf13/cobra-cli).

```bash
cobra-cli add ...
go tool cobra-cli add ...
```
Loading
Loading