Skip to content

Commit cbb68a4

Browse files
committed
ci(circleci): add goreleaser job for releases
Leverage the goreleaser-pro support for monorepo to handle releases for the tags we use for individual components. This resolves ethereum-optimism/platforms-team#403
1 parent b7fb6a5 commit cbb68a4

File tree

7 files changed

+393
-1
lines changed

7 files changed

+393
-1
lines changed

Diff for: .circleci/continue_config.yml

+57-1
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,43 @@ jobs:
348348
- store_test_results:
349349
path: /tmp/test-results
350350

351+
# TODO: this should be in an orb to improve reusability.
352+
go-release:
353+
parameters:
354+
module:
355+
description: Go Module Name
356+
type: string
357+
filename:
358+
description: Goreleaser config file
359+
default: .goreleaser.yaml
360+
type: string
361+
docker:
362+
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
363+
resource_class: large
364+
steps:
365+
- setup_remote_docker
366+
- gcp-cli/install
367+
- gcp-oidc-authenticate:
368+
gcp_cred_config_file_path: /root/gcp_cred_config.json
369+
oidc_token_file_path: /root/oidc_token.json
370+
- checkout
371+
- run:
372+
name: Install goreleaser pro
373+
command: |
374+
mkdir -p /tmp/goreleaser
375+
cd /tmp/goreleaser
376+
curl -L -o goreleaser.tgz https://github.com/goreleaser/goreleaser-pro/releases/download/v2.4.3-pro/goreleaser-pro_Linux_x86_64.tar.gz
377+
tar -xzvf goreleaser.tgz
378+
mv goreleaser /usr/local/bin/goreleaser
379+
- run:
380+
name: Configure Docker
381+
command: |
382+
gcloud auth configure-docker us-docker.pkg.dev
383+
- run:
384+
name: Run goreleaser
385+
command: |
386+
goreleaser release --clean -f ./<<parameters.module>>/<<parameters.filename>>
387+
351388
workflows:
352389
logging:
353390
jobs:
@@ -518,7 +555,7 @@ workflows:
518555
- proxyd
519556
- op-conductor-mon
520557
- peer-mgmt-service
521-
name: <<matrix.module>>-docker-tag
558+
name: <<matrix.docker_name>>-docker-tag
522559
filters:
523560
tags:
524561
only: /^<<matrix.docker_name>>\/v.*/
@@ -528,3 +565,22 @@ workflows:
528565
- oplabs-gcr-release
529566
requires:
530567
- <<matrix.docker_name>>-docker-publish
568+
- go-release:
569+
matrix:
570+
parameters:
571+
module:
572+
- op-signer
573+
- op-txproxy
574+
- op-ufm
575+
- proxyd
576+
- op-conductor-mon
577+
- peer-mgmt-service
578+
name: <<matrix.module>>-go-release
579+
filters:
580+
tags:
581+
only: /^<<matrix.module>>.*/
582+
branches:
583+
ignore: /.*/
584+
module: <<matrix.module>>
585+
context:
586+
- oplabs-gcr-release

Diff for: op-conductor-mon/.goreleaser.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 2
5+
6+
project_name: op-conductor-mon
7+
8+
before:
9+
hooks:
10+
# You may remove this if you don't use go modules.
11+
- go mod tidy
12+
13+
builds:
14+
- id: main
15+
main: ./cmd/monitor
16+
binary: op-conductor-mon
17+
goos:
18+
- linux
19+
- windows
20+
- darwin
21+
goarch:
22+
- amd64
23+
- arm64
24+
ignore:
25+
- goos: windows
26+
goarch: arm64
27+
- goos: linux
28+
goarch: arm64
29+
mod_timestamp: "{{ .CommitTimestamp }}"
30+
ldflags:
31+
- -X main.GitCommit={{ .FullCommit }}
32+
- -X main.GitDate={{ .CommitDate }}
33+
- -X main.Version={{ .Version }}
34+
35+
archives:
36+
- format: tar.gz
37+
# this name template makes the OS and Arch compatible with the results of `uname`.
38+
name_template: "{{ .ProjectName }}-{{.Version}}-{{ tolower .Os }}-{{ .Arch }}"
39+
# use zip for windows archives
40+
wrap_in_directory: true
41+
format_overrides:
42+
- goos: windows
43+
format: zip
44+
45+
changelog:
46+
sort: asc
47+
48+
release:
49+
github:
50+
owner: ethereum-optimism
51+
name: infra
52+
make_latest: false
53+
54+
monorepo:
55+
tag_prefix: op-conductor-mon/
56+
dir: op-conductor-mon

Diff for: op-signer/.goreleaser.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 2
5+
6+
project_name: op-signer
7+
8+
before:
9+
hooks:
10+
# You may remove this if you don't use go modules.
11+
- go mod tidy
12+
13+
builds:
14+
- id: main
15+
main: ./cmd
16+
binary: op-signer
17+
goos:
18+
- linux
19+
- windows
20+
- darwin
21+
goarch:
22+
- amd64
23+
- arm64
24+
ignore:
25+
- goos: windows
26+
goarch: arm64
27+
- goos: linux
28+
goarch: arm64
29+
mod_timestamp: "{{ .CommitTimestamp }}"
30+
ldflags:
31+
- -X main.GitCommit={{ .FullCommit }}
32+
- -X main.GitDate={{ .CommitDate }}
33+
- -X main.Version={{ .Version }}
34+
35+
archives:
36+
- format: tar.gz
37+
# this name template makes the OS and Arch compatible with the results of `uname`.
38+
name_template: "{{ .ProjectName }}-{{.Version}}-{{ tolower .Os }}-{{ .Arch }}"
39+
# use zip for windows archives
40+
wrap_in_directory: true
41+
format_overrides:
42+
- goos: windows
43+
format: zip
44+
45+
changelog:
46+
sort: asc
47+
48+
release:
49+
github:
50+
owner: ethereum-optimism
51+
name: infra
52+
make_latest: false
53+
54+
monorepo:
55+
tag_prefix: op-signer/
56+
dir: op-signer

Diff for: op-txproxy/.goreleaser.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 2
5+
6+
project_name: op-txproxy
7+
8+
before:
9+
hooks:
10+
# You may remove this if you don't use go modules.
11+
- go mod tidy
12+
13+
builds:
14+
- id: main
15+
main: ./cmd
16+
binary: op-txproxy
17+
goos:
18+
- linux
19+
- windows
20+
- darwin
21+
goarch:
22+
- amd64
23+
- arm64
24+
ignore:
25+
- goos: windows
26+
goarch: arm64
27+
- goos: linux
28+
goarch: arm64
29+
mod_timestamp: "{{ .CommitTimestamp }}"
30+
ldflags:
31+
- -X main.GitCommit={{ .FullCommit }}
32+
- -X main.GitDate={{ .CommitDate }}
33+
- -X main.Version={{ .Version }}
34+
35+
archives:
36+
- format: tar.gz
37+
# this name template makes the OS and Arch compatible with the results of `uname`.
38+
name_template: "{{ .ProjectName }}-{{.Version}}-{{ tolower .Os }}-{{ .Arch }}"
39+
# use zip for windows archives
40+
wrap_in_directory: true
41+
format_overrides:
42+
- goos: windows
43+
format: zip
44+
45+
changelog:
46+
sort: asc
47+
48+
release:
49+
github:
50+
owner: ethereum-optimism
51+
name: infra
52+
make_latest: false
53+
54+
monorepo:
55+
tag_prefix: op-txproxy/
56+
dir: op-txproxy

Diff for: op-ufm/.goreleaser.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 2
5+
6+
project_name: op-ufm
7+
8+
before:
9+
hooks:
10+
# You may remove this if you don't use go modules.
11+
- go mod tidy
12+
13+
builds:
14+
- id: main
15+
main: ./cmd/ufm
16+
binary: op-ufm
17+
goos:
18+
- linux
19+
- windows
20+
- darwin
21+
goarch:
22+
- amd64
23+
- arm64
24+
ignore:
25+
- goos: windows
26+
goarch: arm64
27+
- goos: linux
28+
goarch: arm64
29+
mod_timestamp: "{{ .CommitTimestamp }}"
30+
ldflags:
31+
- -X main.GitCommit={{ .FullCommit }}
32+
- -X main.GitDate={{ .CommitDate }}
33+
- -X main.Version={{ .Version }}
34+
35+
archives:
36+
- format: tar.gz
37+
# this name template makes the OS and Arch compatible with the results of `uname`.
38+
name_template: "{{ .ProjectName }}-{{.Version}}-{{ tolower .Os }}-{{ .Arch }}"
39+
# use zip for windows archives
40+
wrap_in_directory: true
41+
format_overrides:
42+
- goos: windows
43+
format: zip
44+
45+
changelog:
46+
sort: asc
47+
48+
release:
49+
github:
50+
owner: ethereum-optimism
51+
name: infra
52+
make_latest: false
53+
54+
monorepo:
55+
tag_prefix: op-ufm/
56+
dir: op-ufm

Diff for: peer-mgmt-service/.goreleaser.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 2
5+
6+
project_name: peer-mgmt-service
7+
8+
before:
9+
hooks:
10+
# You may remove this if you don't use go modules.
11+
- go mod tidy
12+
13+
builds:
14+
- id: main
15+
main: ./cmd/pms
16+
binary: peer-mgmt-service
17+
goos:
18+
- linux
19+
- windows
20+
- darwin
21+
goarch:
22+
- amd64
23+
- arm64
24+
ignore:
25+
- goos: windows
26+
goarch: arm64
27+
- goos: linux
28+
goarch: arm64
29+
mod_timestamp: "{{ .CommitTimestamp }}"
30+
ldflags:
31+
- -X main.GitCommit={{ .FullCommit }}
32+
- -X main.GitDate={{ .CommitDate }}
33+
- -X main.Version={{ .Version }}
34+
35+
archives:
36+
- format: tar.gz
37+
# this name template makes the OS and Arch compatible with the results of `uname`.
38+
name_template: "{{ .ProjectName }}-{{.Version}}-{{ tolower .Os }}-{{ .Arch }}"
39+
# use zip for windows archives
40+
wrap_in_directory: true
41+
format_overrides:
42+
- goos: windows
43+
format: zip
44+
45+
changelog:
46+
sort: asc
47+
48+
release:
49+
github:
50+
owner: ethereum-optimism
51+
name: infra
52+
make_latest: false
53+
54+
monorepo:
55+
tag_prefix: peer-mgmt-service/
56+
dir: peer-mgmt-service

0 commit comments

Comments
 (0)