Skip to content
name: Build and Publish Artifacts
on:
push:
branches:
- main # Adjust this if you want it to run on a different branch or event
- many_linux
- ubuntu
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
# Step 2: Build and tag a Docker image
- name: Build Docker image
run: docker build -t code_contests_builder .
# Step 3: Run the Docker container with a specific command
- name: Run Docker container
run: |
rm -rf wheelhouse/
docker run -v ${{ github.workspace }}:/io code_contests_builder bash -c "cd /io && ./execution/py_tester_bindings/make_python_bindings.sh"
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
# - name: Run tests
# run: |
# p=$(which python)
# uname -a
# echo "python is installed in $p"
# python -m pip install --upgrade pip
# pip install wheelhouse/*.whl --force-reinstall
# mkdir test
# ls -ls /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/code_contests_tester/
# cp execution/py_tester_bindings/test_python_binding.py test/
# python test/test_python_binding.py /usr/bin/python /usr/lib/python
- name: Upload artifacts to workflow
uses: actions/upload-artifact@v2
with:
name: wheel-artifacts
path: wheelhouse/*
- name: Publish to PyPI
run: |
python -m pip install twine
ls -lh wheelhouse/
twine upload wheelhouse/*.whl
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}