From 9609ae77e04acdb78c686d02420eea3253580eed Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Tue, 14 Jan 2025 12:08:13 -0800 Subject: [PATCH 1/6] chore: Stub of the release flow --- .circleci/config.yml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d495628b..ba07c347 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,7 @@ executors: orbs: go: circleci/go@2.2.3 + utils: ethereum-optimism/circleci-utils@0.0.11 commands: # By default, CircleCI does not checkout any submodules @@ -50,6 +51,22 @@ commands: name: Setup golangci-lint command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin << parameters.version >> + install-goreleaser: + parameters: + version: + type: string + default: "2.5.1" + steps: + - run: + name: Install GoReleaser + command: | + echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list + sudo apt -q update -y + sudo apt -q install -y --no-install-recommends goreleaser=<< parameters.version >> + - run: + name: Output GoReleaser version + command: goreleaser --version + install-go-modules: steps: - go/load-mod-cache # Load cached Go modules. @@ -106,6 +123,20 @@ jobs: name: Run tests command: just test-go no_output_timeout: 20m + + go-release: + executor: default + steps: + - checkout-with-submodules + - install-goreleaser + - install-go-modules + - utils/get-github-access-token: + # We match the name of the token environment variable with what GoReleaser expects in .goreleaser.yaml + output-token-name: TAP_REPO_GITHUB_TOKEN + - run: + name: Run GoReleaser + # FIXME Just for the time being we add the --snapshot flag + command: goreleaser release --snapshot --clean workflows: main: @@ -115,4 +146,15 @@ workflows: - go-lint - go-tests: context: - - oplabs-rpc-urls \ No newline at end of file + - oplabs-rpc-urls + release: + jobs: + - go-release: + filters: + tags: + only: + - /^v.*/ + # Without explicitly ignoring all branches, CircleCI will run the job on all branches + # even if no tags have been pushed + branches: + ignore: /.*/ From 4cc4b5305b2aadca376324a64d847e09e4afc2f0 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Tue, 14 Jan 2025 13:20:56 -0800 Subject: [PATCH 2/6] chore: Add github app context --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba07c347..bac728c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -150,6 +150,8 @@ workflows: release: jobs: - go-release: + context: + - circleci-repo-supersim filters: tags: only: From 597feb83849639d80834fd8c1ea5ce8a6920a6de Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Tue, 14 Jan 2025 13:42:59 -0800 Subject: [PATCH 3/6] chore: Use single GH App token with all necessary write permissions --- .circleci/config.yml | 4 +--- .goreleaser.yaml | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bac728c9..9a3c5469 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -130,9 +130,7 @@ jobs: - checkout-with-submodules - install-goreleaser - install-go-modules - - utils/get-github-access-token: - # We match the name of the token environment variable with what GoReleaser expects in .goreleaser.yaml - output-token-name: TAP_REPO_GITHUB_TOKEN + - utils/get-github-access-token - run: name: Run GoReleaser # FIXME Just for the time being we add the --snapshot flag diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a299f642..2d0f7edc 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -37,5 +37,4 @@ brews: description: "Supersim is a local dev environment for the Superchain" repository: owner: ethereum-optimism - name: homebrew-tap - token: "{{ .Env.TAP_REPO_GITHUB_TOKEN }}" \ No newline at end of file + name: homebrew-tap \ No newline at end of file From 0bec047ee7f6810b794d2701c0373dea557cf3ac Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 09:36:57 -0800 Subject: [PATCH 4/6] chore: bump utils orb version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a3c5469..b186741d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ executors: orbs: go: circleci/go@2.2.3 - utils: ethereum-optimism/circleci-utils@0.0.11 + utils: ethereum-optimism/circleci-utils@0.0.12 commands: # By default, CircleCI does not checkout any submodules From 92c8074bfd3fc3ad50fb3f39db84139d2e067748 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 09:38:31 -0800 Subject: [PATCH 5/6] chore: Specify GH token name --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b186741d..70353a65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -130,7 +130,9 @@ jobs: - checkout-with-submodules - install-goreleaser - install-go-modules - - utils/get-github-access-token + - utils/get-github-access-token: + # GoReleaser expects a GITHUB_TOKEN environment variable to be set + output-token-name: GITHUB_TOKEN - run: name: Run GoReleaser # FIXME Just for the time being we add the --snapshot flag From 0aba092861208d8854da7a5cb0035ce5c167061e Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 11:31:34 -0800 Subject: [PATCH 6/6] chore: GoReleaser --- .circleci/config.yml | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70353a65..5f2be413 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 executors: default: docker: - - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.35.0 + - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.55.0 orbs: go: circleci/go@2.2.3 @@ -24,23 +24,6 @@ commands: name: Initialize submodules command: git submodule update --init --recursive - install-foundry: - steps: - # Since CircleCI only sources the $BASH_ENV before each step, we isolate our $PATH modification to a separate step - - run: - name: Setup $PATH for foundry - command: echo 'export PATH=$HOME/.foundry/bin:$PATH' >> $BASH_ENV - - run: - name: Install Foundry - command: | - curl -L https://foundry.paradigm.xyz | bash - foundryup - - run: - name: Output foundry versions - command: | - anvil --version - forge --version - install-golangci-lint: parameters: version: @@ -60,9 +43,9 @@ commands: - run: name: Install GoReleaser command: | - echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list - sudo apt -q update -y - sudo apt -q install -y --no-install-recommends goreleaser=<< parameters.version >> + echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list + apt -q update -y + apt -q install -y --no-install-recommends goreleaser=<< parameters.version >> - run: name: Output GoReleaser version command: goreleaser --version @@ -88,7 +71,6 @@ jobs: FOUNDRY_PROFILE: ci steps: - checkout-with-submodules - - install-foundry - run: name: Run Forge build command: just build-contracts @@ -110,7 +92,6 @@ jobs: executor: default steps: - checkout-with-submodules - - install-foundry - install-go-modules - run: # We need to "rename" some of the variables coming from the CircleCI context @@ -135,8 +116,7 @@ jobs: output-token-name: GITHUB_TOKEN - run: name: Run GoReleaser - # FIXME Just for the time being we add the --snapshot flag - command: goreleaser release --snapshot --clean + command: goreleaser release --clean workflows: main: @@ -155,7 +135,7 @@ workflows: filters: tags: only: - - /^v.*/ + - /^v?\d+\.\d+\.\d+.*?/ # Without explicitly ignoring all branches, CircleCI will run the job on all branches # even if no tags have been pushed branches: