Skip to content

Commit

Permalink
Merge pull request #311 from appgate/release-pipeline-redone
Browse files Browse the repository at this point in the history
Release pipeline redone
  • Loading branch information
kajes authored Oct 17, 2022
2 parents e1ce040 + dc1dcc5 commit 5ef7873
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 152 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/dry-run.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/release-flow.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

86 changes: 43 additions & 43 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,62 @@
env:
- RELEASE_VERSION={{ if index .Env "SDPCTL_VERSION" }}{{ .Env.SDPCTL_VERSION }}{{ else }}dev{{ end }}
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
project_name: sdpctl
before:
hooks:
- make deps
- make clean
- make deps
snapshot:
name_template: "{{ incpatch .Version }}"
changelog:
use: github-native
github_urls:
download: https://github.com/appgate/sdpctl/releases

builds:
- id: sdpctl
main: ./main.go
mod_timestamp: "{{ .CommitTimestamp }}"

- <<: &build_defaults
binary: "{{ if .IsSnapshot }}{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ else }}{{ .ProjectName }}{{ end }}"
main: ./main.go
ldflags:
- -s -w -X "github.com/appgate/sdpctl/cmd.version={{ if .Tag }}{{ .Tag }}{{ else }}dev{{ end }}"
- -X "github.com/appgate/sdpctl/cmd.commit={{ .FullCommit }}"
- -X "github.com/appgate/sdpctl/cmd.buildDate={{ .Date }}"
id: macos
goos: [darwin]
goarch: [arm64, amd64]
env:
- CGO_ENABLED=1
hooks:
post:
- "{{ .Env.HOOK_PATH }}/sign-macos.sh '{{ .Path }}'"

- <<: *build_defaults
id: linux
goos: [linux]
goarch: [amd64, arm64]
env:
- CGO_ENABLED=0
goos:
- linux
- windows
goarch:
- amd64
- arm64
binary: "{{ if .IsSnapshot }}{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ else }}{{ .ProjectName }}{{ end }}"
ldflags:
- -s -w -X "github.com/appgate/sdpctl/cmd.version={{ .Env.RELEASE_VERSION }}"
- -X "github.com/appgate/sdpctl/cmd.commit={{ .Commit }}"
- -X "github.com/appgate/sdpctl/cmd.buildDate={{ .Date }}"
- id: sdpctl-darwin
main: ./main.go
mod_timestamp: "{{ .CommitTimestamp }}"

- <<: *build_defaults
id: windows
goos: [windows]
goarch: [amd64]
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
goos:
- darwin
goarch:
- arm64
- amd64
binary: "{{ if .IsSnapshot }}{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ else }}{{ .ProjectName }}{{ end }}"
ldflags:
- -s -w -X "github.com/appgate/sdpctl/cmd.version={{ .Env.RELEASE_VERSION }}"
- -X "github.com/appgate/sdpctl/cmd.commit={{ .Commit }}"
- -X "github.com/appgate/sdpctl/cmd.buildDate={{ .Date }}"
- CGO_ENABLED=0
hooks:
post:
- "{{ .Env.HOOK_PATH }}/sign-windows.sh '{{ .Path }}'"


universal_binaries:
- replace: false
id: sdpctl-darwin
id: macos
archives:
- format_overrides:
- goos: windows
format: zip
checksum:
name_template: "checksums.txt"
release:
draft: true
prerelease: auto
# signs:
# - artifacts: checksum

nfpms:
- homepage: https://www.appgate.com
maintainer: Appgate Cybersecurity Inc <appgatesdp.support@appgate.com>
Expand Down Expand Up @@ -87,7 +91,3 @@ nfpms:
- groff-message
rpm:
compression: gzip
snapshot:
name_template: "{{ incpatch .Version }}"
changelog:
use: github-native
24 changes: 0 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,3 @@ clean:
install: build
install -d ${DESTDIR}${bindir}
install -m755 build/$(BIN_NAME) ${DESTDIR}${bindir}/

.PHONY: release-dry-run
release-dry-run:
docker run \
--rm \
--env-file .release-env \
-v $(PWD):/go/src/github.com/user/repo \
-w /go/src/github.com/user/repo \
goreleaser/goreleaser-cross:$(GORELEASER_CROSS_VERSION) \
--skip-validate --rm-dist --skip-publish

.PHONY: release
release:
@if [ ! -f ".release-env" ]; then \
echo "\033[91m.release-env is required for release\033[0m";\
exit 1;\
fi
docker run \
--rm \
--env-file .release-env \
-v $(PWD):/go/src/github.com/user/repo \
-w /go/src/github.com/user/repo \
goreleaser/goreleaser-cross:$(GORELEASER_CROSS_VERSION) \
release --rm-dist

0 comments on commit 5ef7873

Please sign in to comment.