Skip to content

Commit

Permalink
Add build workflow multiplatforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Jul 15, 2023
1 parent 7172f39 commit 11c2aed
Show file tree
Hide file tree
Showing 31 changed files with 141 additions and 289,654 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and push

on:
push:
branches:
- "main"

jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/the-candy-shop/starksheet-monorepo/starksheet-cairo:latest
platforms: linux/amd64,linux/arm/v8
context: ./packages/starksheet-cairo
47 changes: 47 additions & 0 deletions packages/starksheet-cairo/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.DS_Store
.temp/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg

# Unit test / coverage reports
.pytest_cache/


# Environments
.env

# vscode project settings
.vscode/
tests/tokens/
calls.csv
daily_sheets.png
deployments
dust_pilots
notebooks
launch.json
tests
build
assets
allow_list.json
41 changes: 20 additions & 21 deletions packages/starksheet-cairo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# pull official base image
FROM python:3.9.16-slim-buster
FROM python:3.9.13

# set work directory in the container
WORKDIR /app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install system dependencies
RUN apt-get update && apt-get install -y gcc libgmp-dev
# install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="$PATH:/root/.local/bin"
RUN poetry config virtualenvs.create false

# install python dependencies
RUN pip install --upgrade pip
RUN pip install poetry

# copy project
COPY . /app/
# install madara swap
WORKDIR /app
COPY poetry.lock .
COPY pyproject.toml .
COPY scripts ./scripts
COPY README.md .
RUN poetry install
# split install in two steps to leverage docker cache
COPY . .
RUN poetry install

# install dependencies
RUN poetry install --no-interaction --no-ansi
# Build contracts
RUN python scripts/starksheet_compile.py

# command to run on container start
CMD ["poetry", "run", "python", "deploy/starksheet.py"]
# Deploy madara swap
ENV STARKNET_NETWORK=sharingan
CMD ["python", "scripts/starksheet_deploy.py"]
48 changes: 0 additions & 48 deletions packages/starksheet-cairo/build/BasicCellRenderer_abi.json

This file was deleted.

Loading

0 comments on commit 11c2aed

Please sign in to comment.