diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index febf28e..632074a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,20 +5,23 @@ on: types: [created, edited] jobs: - releases-matrix: + goreleaser: name: Release Go Binary runs-on: ubuntu-latest - strategy: - matrix: - # build and publish in parallel: linux/amd64, windows/amd64, darwin/amd64 - goos: [linux, windows, darwin] - goarch: [amd64] steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.20 + - name: Checkout + uses: actions/checkout@v2 with: - github_token: ${{ secrets.CR_PAT }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - binary_name: "kubestr" - extra_files: LICENSE README.md + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..10a0bb2 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,35 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod download +builds: + - env: + - CGO_ENABLED=0 + - GO_EXTLINK_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'