Skip to content

Commit

Permalink
ci: use goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelgautier committed Jul 10, 2023
1 parent 763543b commit 31e305b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 8 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ concurrency:

permissions:
contents: write
packages: write

jobs:
build:
Expand Down Expand Up @@ -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 }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

openapi-oathkeeper
openapi-oathkeeper
dist/
56 changes: 56 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]

0 comments on commit 31e305b

Please sign in to comment.