-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add Docker support for running upgrade scripts #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c750bda
1f0f4f3
eea7623
c5948fa
4c8edb8
9cb07c5
c445d7d
15b87cf
a8adfeb
4d391f9
c5520f7
c93b86f
92fbc31
e3addac
596182b
9dc0108
6dd231f
aaa6eea
ead0814
7977435
2f30dde
05c1282
80ab399
f083a68
5a4ceca
2acea4e
a863cdb
4b4712e
94bef28
3765422
54c190c
8344c39
707cc07
0efc403
657fd93
e7f8387
7a6d9a6
784b100
ede1c95
2853daa
d336a84
a022a65
1d77f3a
cb1cbeb
e4fed49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Dependencies (will be installed fresh in container) | ||
| node_modules/ | ||
|
|
||
| # Build artifacts (will be built fresh in container) | ||
| out/ | ||
| cache_forge/ | ||
| cache/ | ||
| artifacts/ | ||
| typechain-types/ | ||
|
|
||
| # Environment files (contain secrets) | ||
| /.env | ||
|
|
||
| # Git | ||
| .git/ | ||
| .gitignore | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # Test artifacts | ||
| broadcast/ | ||
| coverage/ | ||
|
|
||
| # Docker | ||
| Dockerfile | ||
| .dockerignore |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| lib/ | ||
| dist/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Publish Docker | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: ['v*'] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Build and Push Docker Image | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| # "orbit" is a deprecated term; the published image uses "chain-actions" | ||
| images: offchainlabs/chain-actions | ||
| tags: | | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=ref,event=branch | ||
|
Comment on lines
+31
to
+38
|
||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Test Docker | ||
|
|
||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test-docker: | ||
| name: Test Docker Image | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| load: true | ||
| tags: orbit-actions:test | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Run Docker smoke tests | ||
| run: ./test/docker/test-docker.bash | ||
| env: | ||
| DOCKER_IMAGE: orbit-actions:test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| node_modules | ||
| .env | ||
| .DS_Store | ||
|
|
||
| # TypeScript build output | ||
| /dist | ||
|
|
||
| # Hardhat files | ||
| /cache | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||
| FROM node:22-slim | ||||||||
|
|
||||||||
| # Install dependencies for Foundry, git, and jq (for JSON parsing in upgrade scripts) | ||||||||
| RUN apt-get update && apt-get install -y \ | ||||||||
| curl \ | ||||||||
| git \ | ||||||||
| jq \ | ||||||||
| && rm -rf /var/lib/apt/lists/* | ||||||||
|
|
||||||||
| # Install Foundry | ||||||||
| ENV PATH="/root/.foundry/bin:${PATH}" | ||||||||
| RUN curl -L https://foundry.paradigm.xyz | bash && foundryup --install stable | ||||||||
|
|
||||||||
| # Install Yarn Classic (v1) - matches the repo's yarn.lock format | ||||||||
| RUN npm install -g --force yarn@1.22.22 | ||||||||
|
|
||||||||
| WORKDIR /app | ||||||||
|
|
||||||||
| # Copy package files first for better layer caching | ||||||||
| COPY package.json yarn.lock ./ | ||||||||
|
|
||||||||
| # --ignore-scripts: forge install runs separately after full copy | ||||||||
| RUN yarn install --frozen-lockfile --ignore-scripts | ||||||||
|
|
||||||||
| COPY . . | ||||||||
|
||||||||
| COPY . . | |
| COPY . . | |
| RUN forge install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity 0.8.16; | ||
|
|
||
| import "forge-std/Script.sol"; | ||
|
|
||
| interface IRollupCore { | ||
| function wasmModuleRoot() external view returns (bytes32); | ||
| } | ||
|
|
||
| /** | ||
| * @title VerifyNitroContracts1Point2Point1Upgrade | ||
| * @notice Verifies the upgrade to Nitro Contracts 1.2.1 by checking the wasmModuleRoot | ||
| */ | ||
| contract VerifyNitroContracts1Point2Point1Upgrade is Script { | ||
| function run() public view { | ||
| address rollup = vm.envAddress("ROLLUP"); | ||
| bytes32 wasmRoot = IRollupCore(rollup).wasmModuleRoot(); | ||
| console.log("wasmModuleRoot:"); | ||
| console.logBytes32(wasmRoot); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.