diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 00000000..f2fb8f75 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,28 @@ +--- +name: publish github release artifacts with 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: setup-go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - name: capture current date + id: date + run: echo "::set-output name=date::$(date -u '+%Y-%m-%d-%H:%M:%S-%Z')" + - name: goreleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + DATE: ${{ steps.date.outputs.date }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 9a27c27f..0d29be51 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ tmp # prod config file config.toml + +# goreleaser output directory +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..120ecc61 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,29 @@ +before: + hooks: + - go mod download +env: +- CGO_ENABLED=0 +- GOPROXY=https://proxy.golang.org +project_name: athens +builds: +- id: builds + goos: + - linux + - darwin + goarch: + - amd64 + main: cmd/proxy/main.go + binary: athens + ldflags: + - -X "github.com/gomods/athens/pkg/build.version={{ .Tag }}" + - -X "github.com/gomods/athens/pkg/build.buildDate={{ .Env.DATE }}" +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'