Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new goreleaser build chain #1932

Merged
merged 5 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 10 additions & 268 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,272 +1,14 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: kratos

env:
- GOPROXY=https://proxy.golang.org,direct

before:
hooks:
- go mod download
- go mod tidy
- go install github.com/CycloneDX/cyclonedx-gomod@v1.0.0

builds:
-
id: kratos-sqlite-darwin
flags:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/kratos/driver/config.Version={{.Tag}} -X github.com/ory/kratos/driver/config.Commit={{.FullCommit}} -X github.com/ory/kratos/driver/config.Date={{.Date}}
# - "-extldflags '-static'"
binary: kratos
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
goarch:
- amd64
goos:
- darwin
hooks:
post:
- cmd: cyclonedx-gomod app -licenses -json -output "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"
- cmd: ./.releaser/rename.sh "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"
-
id: kratos-sqlite-darwin-arm
flags:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/kratos/driver/config.Version={{.Tag}} -X github.com/ory/kratos/driver/config.Commit={{.FullCommit}} -X github.com/ory/kratos/driver/config.Date={{.Date}}
# - "-extldflags '-static'"
binary: kratos
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
goarch:
- arm64
goos:
- darwin
hooks:
post:
- cmd: cyclonedx-gomod app -licenses -json -output "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"
- cmd: ./.releaser/rename.sh "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"
-
id: kratos-sqlite-linux
flags:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/kratos/driver/config.Version={{.Tag}} -X github.com/ory/kratos/driver/config.Commit={{.FullCommit}} -X github.com/ory/kratos/driver/config.Date={{.Date}}
binary: kratos
env:
- CGO_ENABLED=1
goarch:
- amd64
goos:
- linux
hooks:
post:
- cmd: cyclonedx-gomod app -licenses -json -output "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"
- cmd: ./.releaser/rename.sh "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"
-
id: kratos-sqlite-linux-libmusl
flags:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/kratos/driver/config.Version={{.Tag}} -X github.com/ory/kratos/driver/config.Commit={{.FullCommit}} -X github.com/ory/kratos/driver/config.Date={{.Date}}
binary: kratos
env:
- CGO_ENABLED=1
- CC=musl-gcc
goarch:
- amd64
goos:
- linux
hooks:
post:
- cmd: cyclonedx-gomod app -licenses -json -output "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite-libmusl_{{ .Target }}.bom.json"
- cmd: ./.releaser/rename.sh "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite-libmusl_{{ .Target }}.bom.json"
-
id: kratos-sqlite-windows
flags:
- -tags
- sqlite
# Remove once https://github.com/golang/go/issues/40795 is closed
- -buildmode=exe
ldflags:
- -s -w -X github.com/ory/kratos/driver/config.Version={{.Tag}} -X github.com/ory/kratos/driver/config.Commit={{.FullCommit}} -X github.com/ory/kratos/driver/config.Date={{.Date}}
- "-extldflags '-static'"
binary: kratos
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goarch:
- amd64
goos:
- windows
hooks:
post:
- cmd: cyclonedx-gomod app -licenses -json -output "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"
- cmd: ./.releaser/rename.sh "./dist/{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Target }}.bom.json"

-
id: kratos
ldflags:
- -s -w -X github.com/ory/kratos/driver/config.Version={{.Tag}} -X github.com/ory/kratos/driver/config.Commit={{.FullCommit}} -X github.com/ory/kratos/driver/config.Date={{.Date}}
binary: kratos
env:
- CGO_ENABLED=0
goarch:
- amd64
- 386
- arm
- arm64
goarm:
- 5
- 6
- 7
goos:
- linux
- windows
- darwin
hooks:
post:
- cmd: cyclonedx-gomod app -licenses -json -output "./dist/{{ .ProjectName }}_{{ .Version }}_{{ .Target }}.bom.json"
- cmd: ./.releaser/rename.sh "./dist/{{ .ProjectName }}_{{ .Version }}_{{ .Target }}.bom.json"

archives:
- id: kratos-sqlite
builds:
- kratos-sqlite-windows
- kratos-sqlite-darwin-arm
- kratos-sqlite-darwin
- kratos-sqlite-linux
replacements:
darwin: macos
386: 32bit
amd64: 64bit
arm: arm32
arm64: arm64
format_overrides:
-
goos: windows
format: zip
files:
- CHANGELOG.md
- LICENSE
- README.md
- SECURITY.md
name_template: "{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
includes:
- from_url:
url: https://raw.githubusercontent.com/ory/xgoreleaser/master/build.tmpl.yml

- id: kratos-sqlite-libmusl
builds:
- kratos-sqlite-linux-libmusl
replacements:
darwin: macos
386: 32bit
amd64: 64bit
arm: arm32
format_overrides:
-
goos: windows
format: zip
files:
- CHANGELOG.md
- LICENSE
- README.md
- SECURITY.md
name_template: "{{ .ProjectName }}_{{ .Version }}-sqlite-libmusl_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
variables:
brew_name: kratos

- id: kratos
builds:
- kratos
replacements:
darwin: macos
386: 32bit
amd64: 64bit
arm: arm32
arm64: arm64
format_overrides:
- goos: windows
format: zip
files:
- CHANGELOG.md
- LICENSE
- README.md
- SECURITY.md
brew_description: "The Ory Kratos Identity Platform"

snapshot:
name_template: "{{ .Tag }}-next"
buildinfo_hash: "github.com/ory/kratos/driver/config.Commit"
buildinfo_tag: "github.com/ory/kratos/driver/config.Version"
buildinfo_date: "github.com/ory/kratos/driver/config.Date"

changelog:
sort: asc
filters:
exclude:
- ci skip
- Merge pull request
- Merge branch

brews:
- tap:
owner: ory
name: homebrew-tap
ids:
- kratos-sqlite
homepage: https://www.ory.sh
commit_author:
name: aeneasr
email: 3372410+aeneasr@users.noreply.github.com
install: |
bin.install "kratos"

scoop:
bucket:
owner: ory
name: scoop-kratos
homepage: https://www.ory.sh
commit_author:
name: aeneasr
email: 3372410+aeneasr@users.noreply.github.com

checksum:
algorithm: sha256
extra_files:
- glob: ./dist/*.bom.json

dockers:
- dockerfile: .docker/Dockerfile-sqlite
use: buildx
ids:
- kratos-sqlite-linux-libmusl
image_templates:
- "oryd/kratos:v{{ .Major }}-sqlite"
- "oryd/kratos:v{{ .Major }}.{{ .Minor }}-sqlite"
- "oryd/kratos:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-sqlite"
- "oryd/kratos:{{.Tag}}-sqlite"
- "oryd/kratos:latest-sqlite"
- dockerfile: .docker/Dockerfile
use: buildx
ids:
- kratos
image_templates:
- "oryd/kratos:v{{ .Major }}"
- "oryd/kratos:v{{ .Major }}.{{ .Minor }}"
- "oryd/kratos:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "oryd/kratos:{{.Tag}}"
- "oryd/kratos:latest"

release:
prerelease: auto
name_template: "{{.Tag}}"
ids:
- kratos-sqlite
- kratos-sqlite-libmusl
- kratos
extra_files:
- glob: ./dist/*.bom.json
project_name: kratos
84 changes: 0 additions & 84 deletions .releaser/LICENSE.txt

This file was deleted.

20 changes: 0 additions & 20 deletions .releaser/rename.sh

This file was deleted.

Loading