Skip to content

Commit

Permalink
Merge pull request #318 from ethereum-optimism/jan/circleci--002
Browse files Browse the repository at this point in the history
chore: Release flow migration to CircleCI [2/N]
  • Loading branch information
janjakubnanista authored Jan 16, 2025
2 parents 1bfaef6 + 0aba092 commit 4cec4b9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 23 deletions.
66 changes: 45 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ 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/[email protected]
utils: ethereum-optimism/[email protected]

commands:
# By default, CircleCI does not checkout any submodules
Expand All @@ -23,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:
Expand All @@ -50,6 +34,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/ /' | 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

install-go-modules:
steps:
- go/load-mod-cache # Load cached Go modules.
Expand All @@ -71,7 +71,6 @@ jobs:
FOUNDRY_PROFILE: ci
steps:
- checkout-with-submodules
- install-foundry
- run:
name: Run Forge build
command: just build-contracts
Expand All @@ -93,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
Expand All @@ -106,6 +104,19 @@ 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:
# GoReleaser expects a GITHUB_TOKEN environment variable to be set
output-token-name: GITHUB_TOKEN
- run:
name: Run GoReleaser
command: goreleaser release --clean

workflows:
main:
Expand All @@ -115,4 +126,17 @@ workflows:
- go-lint
- go-tests:
context:
- oplabs-rpc-urls
- oplabs-rpc-urls
release:
jobs:
- go-release:
context:
- circleci-repo-supersim
filters:
tags:
only:
- /^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:
ignore: /.*/
3 changes: 1 addition & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
name: homebrew-tap

0 comments on commit 4cec4b9

Please sign in to comment.