diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f55c3c..35f4009 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ concurrency: permissions: contents: write + packages: write jobs: build: @@ -45,17 +46,20 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - run: git fetch --force --tags - name: Setup Go environment uses: actions/setup-go@v4 with: go-version: 1.19 - - name: Build - run: go build -o openapi-oathkeeper - - - name: Release - uses: softprops/action-gh-release@v1 + - uses: goreleaser/goreleaser-action@v4 with: - files: | - openapi-oathkeeper + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index ccc7ebe..7c33007 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out -openapi-oathkeeper \ No newline at end of file +openapi-oathkeeper +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..9073aa5 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,56 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + - go mod tidy + - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of uname. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: 'checksums.txt' + +snapshot: + name_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +brews: + - name: "{{ .ProjectName }}" + description: "This project aims to automating the generation of Ory Oathkeeper rules from an OpenAPI 3 contract and save a lot of time and effort, especially for larger projects with many endpoints or many services." + license: "MIT" + repository: + owner: cerberauth + name: "{{ .ProjectName }}" + goarm: 6 + test: | + system "#{bin}/{{ .ProjectName }} help" + homepage: https://github.com/cerberauth/openapi-oathkeeper + commit_author: + name: emmanuelgautier + email: git@emmanuelgautier.fr