diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..0b79864b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Checkout and Create Release Version + +on: + push: + tags: + - "*" + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: '~> v2' + args: release --draft --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 00000000..498eaedd --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,53 @@ +version: 2 + +before: + hooks: + - go mod tidy + - go generate ./... + +builds: + - binary: ossutil + flags: + - -trimpath + ldflags: + - -w -s + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + - freebsd + - openbsd + - netbsd + goarch: + - 386 + - amd64 + - arm + - arm64 + - mips64le + - ppc64le + - s390x + - riscv64 + - loong64 + goarm: + - 6 + - 7 + +archives: + - format: tar.gz + name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}" + wrap_in_directory: true + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: "checksums.txt" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"