File tree Expand file tree Collapse file tree 3 files changed +63
-1
lines changed Expand file tree Collapse file tree 3 files changed +63
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Docker
2+
3+ on :
4+ push :
5+ pull_request :
6+ branches : [ main ]
7+
8+ env :
9+ SOLANA_VERSION : 1.6.19
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - uses : actions/checkout@v2
17+ - run : echo "BRANCH=$( echo ${GITHUB_REF##*/} )" >> $GITHUB_ENV
18+ - run : echo "DOCKER_TAG=${BRANCH}" >> $GITHUB_ENV
19+ - run : echo "DOCKER_IMAGE=$( echo ${GITHUB_REPOSITORY}:${DOCKER_TAG} )" >> $GITHUB_ENV
20+ - run : docker build -f docker/Dockerfile --build-arg SOLANA_VERSION=${{ env.SOLANA_VERSION }} --tag ${{ env.DOCKER_IMAGE }} .
21+ # publish to ghcr.io
22+ - run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
23+ - run : docker image tag ${DOCKER_IMAGE} ghcr.io/${DOCKER_IMAGE}
24+ - run : docker image push ghcr.io/${{ env.DOCKER_IMAGE }}
25+ if : startsWith( github.ref, 'refs/tags/' )
26+ # publish to docker.io
27+ - run : echo "${{ secrets.DOCKER_IO_PASS }}" | docker login docker.io -u ${{ secrets.DOCKER_IO_USER }} --password-stdin
28+ - run : docker image tag ${DOCKER_IMAGE} docker.io/pythfoundation/pyth-client:${DOCKER_TAG}
29+ - run : docker image push docker.io/pythfoundation/pyth-client:${DOCKER_TAG}
30+ if : startsWith( github.ref, 'refs/tags/' )
Original file line number Diff line number Diff line change 1- cmake_minimum_required ( VERSION 3.16 )
1+ cmake_minimum_required ( VERSION 3.13 )
22
33# project pyth-client
44project ( pyth-client )
Original file line number Diff line number Diff line change 1+ ARG SOLANA_VERSION
2+
3+ FROM solanalabs/solana:v${SOLANA_VERSION}
4+
5+ RUN apt-get update
6+ RUN apt-get install -y cmake curl g++ git libzstd1 libzstd-dev zlib1g zlib1g-dev
7+
8+ RUN useradd -m pyth
9+ USER pyth
10+ WORKDIR /home/pyth
11+
12+ COPY --chown=pyth:pyth ${GITHUB_WORKSPACE} pyth-client/
13+
14+ RUN cd pyth-client && mkdir build && cd build && cmake .. && make && ctest
15+
16+ RUN echo "\n export PATH=\$ PATH:$HOME/pyth-client/build" >> .bashrc
17+
18+ # Install Rust
19+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
20+
21+ # Link Solana location for makefile
22+ RUN mkdir solana && cp -a /usr/bin/sdk solana
23+
24+ # Build the program
25+ RUN PATH=$PATH:$HOME/.cargo/bin && cd pyth-client/program && make
26+
27+ # Print hash of the program
28+ RUN sha256sum -b pyth-client/target/oracle.so
29+
30+ ENTRYPOINT []
31+ CMD []
32+
You can’t perform that action at this time.
0 commit comments