From 555da03d2a1c67d469d20a676ac91eac99108e1a Mon Sep 17 00:00:00 2001 From: Adam Hughes Date: Fri, 30 Jul 2021 17:59:23 +0000 Subject: [PATCH 1/4] release: initial GoReleaser config --- .goreleaser.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .goreleaser.yml diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..fe5c9d33 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,44 @@ +project_name: siftool + +release: + github: + owner: sylabs + name: sif + +builds: + - binary: siftool + goos: + - darwin + - linux + goarch: + - amd64 + - arm + - arm64 + goarm: + - 6 + - 7 + env: + - CGO_ENABLED=0 + ldflags: '-s -w -X main.version={{ .Version }} -X main.commit={{ .FullCommit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser' + main: ./cmd/siftool + mod_timestamp: '{{ .CommitTimestamp }}' + +archives: + - format: tar.gz + wrap_in_directory: true + name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + files: + - README.md + +checksum: + name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' + +changelog: + sort: asc + filters: + exclude: + - '^dev:' + - '^docs:' + - '^test:' + - '^Merge branch' + - '^Merge pull request' From a9cedf7d6b9b2744c1529642b41b6d09faec1a3d Mon Sep 17 00:00:00 2001 From: Adam Hughes Date: Fri, 30 Jul 2021 18:01:04 +0000 Subject: [PATCH 2/4] ci: add release-test job --- .circleci/config.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b31bacb8..d20f92cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,6 +63,14 @@ jobs: - codecov/upload: file: cover.out + release-test: + executor: golang + steps: + - checkout + - run: + name: Test Release + command: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish + workflows: version: 2 @@ -73,3 +81,4 @@ workflows: - check-go-mod - build-source - unit-test + - release-test From d0f48dd38a1b3896bf311d48d9eeef1b9a7c4746 Mon Sep 17 00:00:00 2001 From: Adam Hughes Date: Fri, 30 Jul 2021 18:09:14 +0000 Subject: [PATCH 3/4] ci: add tagged-release workflow with publish-release job --- .circleci/config.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d20f92cb..21aa0669 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,6 +71,14 @@ jobs: name: Test Release command: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish + publish-release: + executor: golang + steps: + - checkout + - run: + name: Publish Release + command: curl -sL https://git.io/goreleaser | bash + workflows: version: 2 @@ -82,3 +90,13 @@ workflows: - build-source - unit-test - release-test + + tagged-release: + jobs: + - publish-release: + filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*(-.*)*/ + context: github-release From f271843e27021492c200abfa803e15bcdc30bbe9 Mon Sep 17 00:00:00 2001 From: Adam Hughes Date: Fri, 30 Jul 2021 18:09:47 +0000 Subject: [PATCH 4/4] ci: rename build_and_test workflow for consistency --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 21aa0669..a9e9b436 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,7 +82,7 @@ jobs: workflows: version: 2 - build_and_test: + build-and-test: jobs: - lint-markdown - lint-source