Skip to content
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

Build Godwoken v0.11.0 #90

Merged
merged 5 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 38 additions & 32 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
# schedule:
# - cron: '22 3 * * *'
push:
branches: [ main, 'v0.10*', '0.10*' ]
branches: [ main, 'v0.11*', '0.11*' ]
# Publish semver tags as releases.
tags: [ 'v*.*.*', '0.10.*', '1.*' ]
tags: [ 'v*.*.*', '0.11.*', '1.*' ]

env:
# Use docker.io for Docker Hub if empty
Expand All @@ -18,7 +18,8 @@ env:

jobs:
docker-build-push:
runs-on: ubuntu-latest
# Same as image base
runs-on: ubuntu-20.04
# Map the meta step outputs to this job outputs
outputs:
image_name: ${{ steps.result.outputs.image_name }}
Expand Down Expand Up @@ -97,33 +98,35 @@ jobs:
working-directory: build/clerkb
run: yarn && make all-via-docker

- name: Cache of component.godwoken-scripts
id: godwoken-scripts-cache
uses: actions/cache@v3
with:
path: |
build/godwoken-scripts/build/release/*
build/godwoken-scripts/c/build/*-generator
build/godwoken-scripts/c/build/*-validator
build/godwoken-scripts/c/build/account_locks/*
key: component.godwoken-scripts-${{ steps.prepare.outputs.godwoken-scripts-sha1 }}
- name: Build godwoken-scripts
if: steps.godwoken-scripts-cache.outputs.cache-hit != 'true'
working-directory: build/godwoken-scripts
run: cd c && make && cd .. && capsule build --release --debug-output

- name: Cache of component.godwoken-polyjuice
id: godwoken-polyjuice-cache
uses: actions/cache@v3
with:
path: |
build/godwoken-polyjuice/build/*generator*
build/godwoken-polyjuice/build/*validator*
key: component.godwoken-polyjuice-${{ steps.prepare.outputs.godwoken-polyjuice-sha1 }}
- name: Build godwoken-polyjuice
if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true'
working-directory: build/godwoken-polyjuice
run: make all-via-docker
# Skip building godwoken-scripts because Godwoken v0 is in maintenance mode with no change.
# - name: Cache of component.godwoken-scripts
# id: godwoken-scripts-cache
# uses: actions/cache@v3
# with:
# path: |
# build/godwoken-scripts/build/release/*
# build/godwoken-scripts/c/build/*-generator
# build/godwoken-scripts/c/build/*-validator
# build/godwoken-scripts/c/build/account_locks/*
# key: component.godwoken-scripts-${{ steps.prepare.outputs.godwoken-scripts-sha1 }}
# - name: Build godwoken-scripts
# if: steps.godwoken-scripts-cache.outputs.cache-hit != 'true'
# working-directory: build/godwoken-scripts
# run: cd c && make && cd .. && capsule build --release --debug-output

# Skip building godwoken-polyjuice because Godwoken v0 is in maintenance mode with no change.
# - name: Cache of component.godwoken-polyjuice
# id: godwoken-polyjuice-cache
# uses: actions/cache@v3
# with:
# path: |
# build/godwoken-polyjuice/build/*generator*
# build/godwoken-polyjuice/build/*validator*
# key: component.godwoken-polyjuice-${{ steps.prepare.outputs.godwoken-polyjuice-sha1 }}
# - name: Build godwoken-polyjuice
# if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true'
# working-directory: build/godwoken-polyjuice
# run: make all-via-docker

- name: Cache of component.godwoken
id: godwoken-cache
Expand All @@ -145,7 +148,11 @@ jobs:
- name: Build godwoken
if: steps.godwoken-cache.outputs.cache-hit != 'true'
working-directory: build/godwoken
run: rustup component add rustfmt && CARGO_PROFILE_RELEASE_LTO=true cargo build --release
env:
# For ckb-rocksdb.
PORTABLE: true
CARGO_PROFILE_RELEASE_LTO: thin
run: rustup component add rustfmt && cargo build --release

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
Expand Down Expand Up @@ -208,7 +215,6 @@ jobs:
docker run --rm ${{ env.IMAGE }} gw-tools --version
docker run --rm ${{ env.IMAGE }} ckb --version
docker run --rm ${{ env.IMAGE }} ckb-cli --version
docker run --rm ${{ env.IMAGE }} ckb-indexer --version
docker run --rm ${{ env.IMAGE }} find /scripts -type f -exec sha1sum {} \;

- name: Record image info to the outputs of this jobs
Expand Down
41 changes: 18 additions & 23 deletions Dockerfile.fast
Original file line number Diff line number Diff line change
@@ -1,45 +1,40 @@
FROM ubuntu:21.04
FROM ubuntu:20.04

RUN mkdir -p /scripts/godwoken-scripts \
&& mkdir -p /scripts/godwoken-polyjuice \
&& mkdir -p /scripts/clerkb \
&& mkdir /ckb \
&& mkdir /ckb-indexer
&& mkdir -p /scripts/clerkb

RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y curl unzip \
&& apt-get clean \
&& echo 'Finished installing OS updates'

# ckb
RUN cd /ckb \
&& curl -LO https://github.com/nervosnetwork/ckb/releases/download/v0.101.7/ckb_v0.101.7_x86_64-unknown-linux-gnu.tar.gz \
&& tar xzf ckb_v0.101.7_x86_64-unknown-linux-gnu.tar.gz \
&& cp ckb_v0.101.7_x86_64-unknown-linux-gnu/ckb /bin/ckb \
&& cp ckb_v0.101.7_x86_64-unknown-linux-gnu/ckb-cli /bin/ckb-cli \
# Install ckb and ckb-cli.
RUN mkdir -p /ckb && cd /ckb \
&& curl -LO https://github.com/nervosnetwork/ckb/releases/download/v0.111.0/ckb_v0.111.0_x86_64-unknown-linux-gnu-portable.tar.gz \
&& tar xzf ckb_v0.111.0_x86_64-unknown-linux-gnu-portable.tar.gz \
&& cp ckb_v0.111.0_x86_64-unknown-linux-gnu-portable/ckb /bin/ \
&& cp ckb_v0.111.0_x86_64-unknown-linux-gnu-portable/ckb-cli /bin/ \
&& rm -rf /ckb

# ckb-indexer
RUN cd /ckb-indexer \
&& curl -LO https://github.com/nervosnetwork/ckb-indexer/releases/download/v0.3.2/ckb-indexer-0.3.2-linux.zip \
&& unzip ckb-indexer-0.3.2-linux.zip && tar xzf ckb-indexer-linux-x86_64.tar.gz \
&& cp /ckb-indexer/ckb-indexer /bin/ckb-indexer \
&& rm -rf /ckb-indexer

# /scripts/clerkb
COPY build/clerkb/build/debug/poa /scripts/clerkb/
COPY build/clerkb/build/debug/state /scripts/clerkb/

# Copy from previous image because godwoken-scripts cannot be built as is.
COPY --from=ghcr.io/nervosnetwork/godwoken-prebuilds:v0.10.7 /scripts/godwoken-scripts /scripts/godwoken-scripts
# /scripts/godwoken-scripts
COPY build/godwoken-scripts/build/release/* /scripts/godwoken-scripts/
COPY build/godwoken-scripts/c/build/*-generator /scripts/godwoken-scripts/
COPY build/godwoken-scripts/c/build/*-validator /scripts/godwoken-scripts/
COPY build/godwoken-scripts/c/build/account_locks/* /scripts/godwoken-scripts/
# COPY build/godwoken-scripts/build/release/* /scripts/godwoken-scripts/
# COPY build/godwoken-scripts/c/build/*-generator /scripts/godwoken-scripts/
# COPY build/godwoken-scripts/c/build/*-validator /scripts/godwoken-scripts/
# COPY build/godwoken-scripts/c/build/account_locks/* /scripts/godwoken-scripts/

# Copy from previous image because godwoken-scripts cannot be built as is.
COPY --from=ghcr.io/nervosnetwork/godwoken-prebuilds:v0.10.7 /scripts/godwoken-polyjuice /scripts/godwoken-polyjuice
# /scripts/godwoken-polyjuice
COPY build/godwoken-polyjuice/build/*generator* /scripts/godwoken-polyjuice/
COPY build/godwoken-polyjuice/build/*validator* /scripts/godwoken-polyjuice/
# COPY build/godwoken-polyjuice/build/*generator* /scripts/godwoken-polyjuice/
# COPY build/godwoken-polyjuice/build/*validator* /scripts/godwoken-polyjuice/

# godwoken
COPY build/godwoken/target/release/godwoken /bin/godwoken
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ POLYJUICE_REPO := https://github.com/nervosnetwork/godwoken-polyjuice.git
CLERKB_REPO := https://github.com/nervosnetwork/clerkb.git

# components tags
GODWOKEN_REF := v0.10.7 # https://github.com/nervosnetwork/godwoken/releases/tag/v0.10.7
GODWOKEN_REF := v0.11.0 # https://github.com/godwokenrises/godwoken/tree/v0.11.0
GODWOKEN_SCRIPTS_REF := v0.9.0 # https://github.com/nervosnetwork/godwoken-scripts/releases/tag/v0.9.0
POLYJUICE_REF := 0.8.14 # https://github.com/nervosnetwork/godwoken-polyjuice/releases/tag/0.8.14
CLERKB_REF := v0.4.0
Expand Down
Loading