From dfc6062bf1c0e7ce3451efb813a0874b025cc1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Luka=C5=A1=C3=ADk?= Date: Tue, 25 Aug 2020 20:44:59 +0200 Subject: [PATCH] Let's try that goreleaser magic --- .github/workflows/release.yml | 29 +++++++++++++++ .goreleaser.yml | 69 +++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d9cf62c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +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.14 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + 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..6bae428 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,69 @@ +# 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 +# # you may remove this if you don't need go generate +# - go generate ./... + +builds: +- env: + - CGO_ENABLED=0 + main: ./cli/gocomply_xsd2go/main.go + binary: gocomply_xsd2go + + goos: + - windows + - darwin + - linux + goarch: + - 386 + - amd64 + - arm + - arm64 + +archives: +- replacements: + darwin: macOS + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: 'checksums.txt' + algorithm: sha256 +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +nfpms: + - id: gocomply_xsd2go + + file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Release }}.{{ .Arch }}" + replacements: + 386: i686 + amd64: x86_64 + arm: aarch32 + arm64: aarch64 + + formats: + - deb + - rpm + + bindir: /usr/bin + + homepage: github.com/GoComply/xsd2go + license: The Unlicense + description: Automatically generate golang xml parser based on XSD + release: 1