From 5f52e9a5e3272241b9a4b0053485e08e31c97327 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 5 Dec 2025 16:36:51 +0800 Subject: [PATCH 1/3] base development image --- docker/Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..24fe406 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:22.04 + +# default shell +SHELL ["/bin/bash", "-c"] + +# base deps +RUN apt-get update \ + && apt-get install -y python3 python3-pip make g++ build-essential wget curl ca-certificates git vim\ + && rm -rf /var/lib/apt/lists/* + +# nvm & nodejs +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash +RUN source /root/.nvm/nvm.sh \ + && nvm install 22 \ + && npm install -g npm@latest + +# vyper +RUN pip3 install vyper==0.2.8 + +# pnpm +RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash - + +# foundry +RUN curl -L https://foundry.paradigm.xyz | bash +RUN /root/.foundry/bin/foundryup --install nightly + +WORKDIR /workspace From 67400e618c828dbf10cc7c7f59601787138ca57f Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 5 Dec 2025 19:52:42 +0800 Subject: [PATCH 2/3] publish workflow --- .github/workflows/sunhat-dev-publish.yml | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/sunhat-dev-publish.yml diff --git a/.github/workflows/sunhat-dev-publish.yml b/.github/workflows/sunhat-dev-publish.yml new file mode 100644 index 0000000..3c92774 --- /dev/null +++ b/.github/workflows/sunhat-dev-publish.yml @@ -0,0 +1,42 @@ +name: Publish sunaget/sunhat-dev + +on: + workflow_dispatch: + inputs: + image_tag: + description: 'tag of image(e.g. 0.1.0)' + required: true + type: string + +jobs: + build-and-push: + runs-on: ubuntu-latest + + environment: release + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: sunagent/sunhat-dev + tags: | + type=raw,value=${{ github.event.inputs.image_tag }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 22b8d793040fab26dab8d026ecd9973c291ae2d9 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 5 Dec 2025 20:41:45 +0800 Subject: [PATCH 3/3] build x86 & arm arch images --- .github/workflows/sunhat-dev-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sunhat-dev-publish.yml b/.github/workflows/sunhat-dev-publish.yml index 3c92774..d3904ec 100644 --- a/.github/workflows/sunhat-dev-publish.yml +++ b/.github/workflows/sunhat-dev-publish.yml @@ -30,12 +30,14 @@ jobs: with: images: sunagent/sunhat-dev tags: | + type=sha,prefix=,suffix=,format=short type=raw,value=${{ github.event.inputs.image_tag }} - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . + platforms: linux/amd64,linux/arm64 file: ./docker/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }}