diff --git a/.circleci/config.yml b/.circleci/config.yml index d495628b..5f2be413 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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/go@2.2.3 + utils: ethereum-optimism/circleci-utils@0.0.12 commands: # By default, CircleCI does not checkout any submodules @@ -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: @@ -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. @@ -71,7 +71,6 @@ jobs: FOUNDRY_PROFILE: ci steps: - checkout-with-submodules - - install-foundry - run: name: Run Forge build command: just build-contracts @@ -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 @@ -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: @@ -115,4 +126,17 @@ workflows: - go-lint - go-tests: context: - - oplabs-rpc-urls \ No newline at end of file + - 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: /.*/ 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