diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ff70b2a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: goreleaser + +on: + push: + tags: + - '*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Import GPG key + id: import_gpg + run: echo -e "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index dbe1852..f1540ec 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,15 +1,9 @@ -# 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 vgo - go mod tidy - # you may remove this if you don't need go generate - # - go generate ./... builds: - env: - CGO_ENABLED=0 - binary: terraform-provider-unifi_v{{.Version}} goos: - freebsd - openbsd @@ -25,46 +19,27 @@ builds: ignore: - goos: darwin goarch: '386' - - goos: darwin - goarch: arm - - goos: darwin - goarch: arm64 - goos: openbsd goarch: arm - goos: openbsd goarch: arm64 - - goos: solaris - goarch: arm - - goos: solaris - goarch: arm64 - - goos: solaris - goarch: '386' - - goos: windows - goarch: arm - - goos: windows - goarch: arm64 + binary: '{{ .ProjectName }}_v{{ .Version }}' archives: - format: zip name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' - replacements: - # darwin: Darwin - # linux: Linux - # windows: Windows - # 386: i386 - # amd64: x86_64 checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' algorithm: sha256 -# signs: -# - artifacts: checksum +signs: + - artifacts: checksum + args: + - "--local-user" + - "{{ .Env.GPG_FINGERPRINT }}" + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}" release: draft: true -snapshot: - name_template: "{{ .Tag }}-next" changelog: - skip: true - # sort: asc - # filters: - # exclude: - # - '^docs:' - # - '^test:' + skip: true \ No newline at end of file