diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..bc11730 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + exclude: + authors: + - dependabot + categories: + - title: New Features + labels: + - "Type: Enhancement" + - title: Bug Fixes + labels: + - "Type: Bug" + - title: Maintenance + labels: + - "Type: Maintenance" + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml new file mode 100644 index 0000000..242f64e --- /dev/null +++ b/.github/workflows/release-binary.yml @@ -0,0 +1,30 @@ +name: Release Binary + +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: "Check out code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Set up Go" + uses: actions/setup-go@v5 + with: + go-version: 1.22.x + + - name: "Create release on GitHub" + uses: goreleaser/goreleaser-action@v4 + with: + args: "release --clean" + version: latest + workdir: . + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 0000000..1dfee33 --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,28 @@ +name: Release Test + +on: + pull_request: + paths: + - '**.go' + - '**.mod' + workflow_dispatch: + +jobs: + release-test: + runs-on: ubuntu-latest + steps: + - name: "Check out code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22.x + + - name: release test + uses: goreleaser/goreleaser-action@v4 + with: + args: "release --clean --snapshot" + version: latest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b26fae --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/jswhois diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..68441b9 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,32 @@ +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - 386 + - arm + - arm64 + ignore: + - goos: darwin + goarch: '386' + - goos: windows + goarch: 'arm' + - goos: windows + goarch: 'arm64' + binary: '{{ .ProjectName }}' + main: ./jswhois.go + +archives: +- format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}' + +checksum: + algorithm: sha256