-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from ethereum-optimism/jan/circleci--002
chore: Release flow migration to CircleCI [2/N]
- Loading branch information
Showing
2 changed files
with
46 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
- 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: /.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters