Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
112 changes: 74 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,63 +1,99 @@
#FROM alpine:3.18.2 as build
FROM ubuntu:20.04 as build
FROM ubuntu:22.04 AS base

#RUN apk add --no-cache 7zip wget
RUN apt-get update && apt-get install -y p7zip-full wget
RUN mkdir -p /target/lib /target/fift /target/bin
RUN apt-get update && apt-get install -y \
openssl \
git \
curl \
make \
&& apt-get clean

FROM base AS build
SHELL ["/bin/bash", "-c"]
ENV HOME=/root
WORKDIR /src
RUN mkdir -p /target/lib /target/fift /target/bin

RUN apt-get update
RUN apt-get install -y build-essential cmake g++ gcc libboost-all-dev libclang-dev git unzip curl
RUN apt-get install -y libssl-dev pkg-config p7zip-full

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="${HOME}/.cargo/bin:${PATH}"
# export CARGO_NET_GIT_FETCH_WITH_CLI=true
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN git config --global net.git-fetch-with-cli true

RUN wget --quiet https://github.com/ton-blockchain/ton/releases/download/v2023.10/ton-linux-x86_64.zip
RUN 7z x ton-linux-x86_64.zip && rm ton-linux-x86_64.zip
ARG TON_VERSION=2024.06
RUN curl -sL -o ton-linux-x86_64.zip https://github.com/ton-blockchain/ton/releases/download/v${TON_VERSION}/ton-linux-x86_64.zip
RUN unzip ton-linux-x86_64.zip && rm ton-linux-x86_64.zip
RUN mv lib/* /target/fift
RUN mv smartcont /target/
RUN mv * /target/bin

RUN wget --quiet https://github.com/tonlabs/TON-Solidity-Compiler/releases/download/0.71.0/solc_0_71_0_linux.gz
RUN 7z x solc_0_71_0_linux.gz && rm solc_0_71_0_linux.gz && mv * /target/bin

RUN wget --quiet https://github.com/tonlabs/TVM-linker/releases/download/0.20.5/tvm_linker_0_20_5_linux.gz
RUN 7z x tvm_linker_0_20_5_linux.gz && rm tvm_linker_0_20_5_linux.gz && mv * /target/bin

RUN wget --quiet https://github.com/tonlabs/TON-Solidity-Compiler/releases/download/0.71.0/sold_0_71_0_linux.gz
RUN 7z x sold_0_71_0_linux.gz && rm sold_0_71_0_linux.gz && mv * /target/bin

RUN wget --quiet https://github.com/tonlabs/TON-Solidity-Compiler/releases/download/0.71.0/stdlib_sol_0_71_0.tvm.gz
RUN 7z x stdlib_sol_0_71_0.tvm.gz && rm stdlib_sol_0_71_0.tvm.gz && mv * /target/lib

RUN wget --quiet https://github.com/tonlabs/tonos-cli/releases/download/0.35.4/tonos-cli-0_35_4-linux.gz
RUN 7z x tonos-cli-0_35_4-linux.gz && rm tonos-cli-0_35_4-linux.gz && mv * /target/bin

RUN wget --quiet https://github.com/gosh-sh/gosh/releases/download/6.1.35/git-remote-gosh-linux-amd64.tar.gz
RUN 7z x git-remote-gosh-linux-amd64.tar.gz -so | 7z x -aoa -si -ttar -o"git-remote-gosh-linux-amd64" &&\
rm git-remote-gosh-linux-amd64.tar.gz &&\
mv git-remote-gosh-linux-amd64/* /target/bin
ARG SOLD_VERSION="0.69.0 0.70.0 0.71.0 0.72.0 0.73.0 0.74.0 0.75.0 0.76.0"
ARG SOLD_REPO="https://github.com/everx-labs/TVM-Solidity-Compiler.git"
RUN for v in ${SOLD_VERSION}; do \
cargo install --tag ${v} --git ${SOLD_REPO}; \
cp ${HOME}/.cargo/bin/sold /target/bin/sold; \
cp /target/bin/sold /target/bin/sold-${v}; \
done

ARG GOSH_SOLD_VERSION="gosh_0.72.0"
ARG GOSH_SOLD_REPO="https://github.com/gosh-sh/TON-Solidity-Compiler.git"
RUN cargo install --tag ${GOSH_SOLD_VERSION} --git ${GOSH_SOLD_REPO}
RUN cp ${HOME}/.cargo/bin/sold /target/bin/sold-gosh

ARG EVER_ASSEMBLER_VERSION="1.6.9"
ARG EVER_ASSEMBLER_REPO="https://github.com/everx-labs/ever-assembler.git"
RUN cargo install --tag ${EVER_ASSEMBLER_VERSION} --git ${EVER_ASSEMBLER_REPO}
RUN cp ${HOME}/.cargo/bin/asm /target/bin/ever-asm
RUN cp ${HOME}/.cargo/bin/disasm /target/bin/ever-disasm

ARG TVM_ASM_REV="211356a"
ARG TVM_ASM_REPO="https://github.com/broxus/everscale-asm.git"
RUN cargo install --rev ${TVM_ASM_REV} --git ${TVM_ASM_REPO}
RUN cp ${HOME}/.cargo/bin/tvmasm /target/bin/tvm-asm
#
#ARG EVER_CLI_VERSION="0.38.2"
#ARG EVER_CLI_REPO="https://github.com/everx-labs/ever-cli.git"
#RUN cargo install --tag ${EVER_CLI_VERSION} --git ${EVER_CLI_REPO}
#RUN cargo install --tag 0.38.2 --git https://github.com/everx-labs/ever-cli.git
#RUN cp $HOME/.cargo/bin/ever-cli /target/bin/ever-cli
#
#ARG GOSH_VERSION="6.2.36"
#ARG GOSH_REPO="https://github.com/gosh-sh/gosh"
#RUN curl -sL -o git-remote-gosh-linux-amd64.tar.gz ${GOSH_REPO}/releases/download/${GOSH_VERSION}/git-remote-gosh-linux-amd64.tar.gz
#RUN 7z x git-remote-gosh-linux-amd64.tar.gz -so | 7z x -aoa -si -ttar -o"git-remote-gosh-linux-amd64" &&\
# rm git-remote-gosh-linux-amd64.tar.gz &&\
# mv git-remote-gosh-linux-amd64/* /target/bin
#


#ARG TVM_CLI_VERSION="v2.0.1.an"
#ARG TVM_CLI_REPO="https://github.com/tvmlabs/tvm-sdk.git"
#RUN cargo install --target tvm_cli --bin tvm-cli --target-dir /target/bin --tag ${TVM_CLI_VERSION} --git ${TVM_CLI_REPO}

RUN chmod +x /target/bin/*

#FROM alpine:3.18.2
FROM python:3.10.12-slim-bullseye
FROM base

LABEL "com.github.actions.name"="TVM Action"
LABEL "com.github.actions.description"="Action for TVM can be used for development on TON, Everscale, Gosh, Venom"
LABEL "com.github.actions.icon"="play-circle"
LABEL "com.github.actions.color"="gray-dark"

RUN apt-get update && apt-get install -y \
openssl \
git \
make \
&& apt-get clean

COPY --from=build /target/bin/* /usr/local/bin
COPY --from=build /target/fift /usr/local/lib/fift
COPY --from=build /target/smartcont /usr/local/lib/smartcont
COPY --from=build /target/lib /usr/local/lib

RUN pip install bitstring==3.1.9 toncli
COPY etc/config.ini /root/.config/toncli/config.ini

ENV FIFTPATH=/usr/local/lib/fift
ENV TVM_LINKER_LIB_PATH=/usr/local/lib/stdlib_sol_0_71_0.tvm

ARG UID=1000
ARG GID=1000
RUN mkdir -p /src && chown -R ${UID}:${GID} /src
RUN if ! getent group ${GID}; then groupadd -g ${GID} user; fi
RUN if ! id -u ${UID}; then useradd -u ${UID} -g ${GID} -s /bin/bash -m /src; fi
WORKDIR /src
USER ${UID}
CMD ["/bin/bash"]
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

## Toolchain

- [fift, func, lite-client, tonlib-cli, etc](https://github.com/ton-blockchain/ton) `v2023.10`
- [toncli](https://github.com/disintar/toncli/releases) `v0.0.43`
- [solc, sold](https://github.com/tonlabs/TON-Solidity-Compiler) `v0.71.0`
- [tvm_linker](https://github.com/tonlabs/TVM-linker) `v0.20.5`
- [tonos-cli](https://github.com/tonlabs/tonos-cli) `v0.35.4`
- [git-remote-gosh](https://docs.gosh.sh/working-with-gosh/git-remote-helper/) `v6.1.35`
- GNU Make `v4.3`
- [fift, func, lite-client, tonlib-cli, etc](https://github.com/ton-blockchain/ton/releases/tag/v2024.06) `v2024.06`
- [`sold`](https://github.com/tonlabs/TON-Solidity-Compiler) `v0.69.0` `v0.70.0` ... `v0.76.0`
- [`ever-asm`, `ever-disasm`](https://github.com/everx-labs/ever-assembler) `v1.6.9`
- [tvm-asm](https://github.com/broxus/everscale-asm) `r211356a`
- [ever-cli](https://github.com/everx-labs/ever-cli) `v0.38.2`
- [git-remote-gosh](https://docs.gosh.sh/working-with-gosh/git-remote-helper/) `v6.2.36`
- [sold-gosh](https://github.com/gosh-sh/TON-Solidity-Compiler) `v0.72.0`
- [tvm-cli](https://github.com/tvmlabs/tvm-sdk/tree/main/tvm_cli) `v2.0.1.an`
- GNU Make `v4.4.1`
- git `v2.45.2`

## Example usage

Expand Down Expand Up @@ -66,6 +69,16 @@ jobs:
```bash
got clone https://github.com/ever-guild/tvm-action.git
cd tvm-action
```

#### Build image
```bash
docker build -t tvm-action .
docker run --rm -it tvm-action bash
```

#### Build develop image
```bash
docker build -t tvm-action-build --target build .
docker run --rm -it tvm-action-build bash
```
11 changes: 11 additions & 0 deletions aliases.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
alias docker-run='docker run --rm -i -v $(pwd):/src'
alias tvm-action='docker-run ghcr.io/ever-guild/tvm-action'
alias tvm-action='docker-run tvm-action'
alias sold='tvm-action sold'
alias ever-cli='tvm-action ever-cli'
alias fift='tvm-action fift'
alias func='tvm-action func'
alias ever-asm='tvm-action ever-asm'
alias ever-disasm='tvm-action ever-disasm'
alias tvm-asm='tvm-action tvm-asm'
alias sold-gosh='tvm-action sold-gosh'