diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..cbc0f0a --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,35 @@ +--- +name: goreleaser + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - + 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/.gitignore b/.gitignore index 3a1179e..4b1eb54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build +dist extracted* diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..59d6562 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,51 @@ +--- +env: + - GO111MODULE=on + - CGO_ENABLED=0 + +before: + hooks: + - go mod download + +builds: + - id: bc-linux + main: ./cmd/main.go + binary: bc + ldflags: + - -X code.cloudfoundry.org/bosh-compile-action/pkg/version.Version={{.Version}} -X code.cloudfoundry.org/bosh-compile-action/pkg/version.Revision={{.ShortCommit}} -X code.cloudfoundry.org/bosh-compile-action/pkg/version.BuildDate={{.CommitDate}} -X code.cloudfoundry.org/bosh-compile-action/pkg/version.BuiltBy=goreleaser + goos: + - linux + goarch: + - amd64 + - arm64 + - s390x + - ppc64le + + - id: bc-darwin + main: ./cmd/main.go + binary: bc + ldflags: + - -X code.cloudfoundry.org/bosh-compile-action/pkg/version.Version={{.Version}} -X code.cloudfoundry.org/bosh-compile-action/pkg/version.Revision={{.ShortCommit}} -X code.cloudfoundry.org/bosh-compile-action/pkg/version.BuildDate={{.CommitDate}} -X code.cloudfoundry.org/bosh-compile-action/pkg/version.BuiltBy=goreleaser + goos: + - darwin + goarch: + - amd64 + - arm64 + +archives: + - name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}" + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: "{{ .ProjectName }}-checksums.txt" + algorithm: sha256 + +changelog: + skip: false + +release: + draft: false + prerelease: false + name_template: "{{.Tag}}"