Skip to content

Commit

Permalink
always upload artifacts for the build and add windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Bam4d committed Jun 22, 2023
1 parent 3f12e51 commit 410cb3a
Showing 1 changed file with 65 additions and 6 deletions.
71 changes: 65 additions & 6 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ jobs:
cmake --build build_wasm --config Release
- name: Upload WASM
if: github.ref == 'refs/heads/master' || contains(github.head_ref, 'release-test')
uses: actions/upload-artifact@v3
with:
name: griddlyjs.wasm
path: Release/bin/griddlyjs.wasm

- name: Upload JS
if: github.ref == 'refs/heads/master' || contains(github.head_ref, 'release-test')
uses: actions/upload-artifact@v3
with:
name: griddlyjs.js
Expand Down Expand Up @@ -122,14 +120,75 @@ jobs:
/opt/python/$PYBIN/bin/poetry run pytest .
- name: Python Package
if: github.ref == 'refs/heads/master' || contains(github.head_ref, 'release-test')
run: |
cd python
/opt/python/$PYBIN/bin/poetry build --format=wheel
# Upload the built wheels
- name: Upload wheel artifacts
if: github.ref == 'refs/heads/master' || contains(github.head_ref, 'release-test')
uses: actions/upload-artifact@v3
with:
path: python/dist/*.whl

build-windows:
runs-on: windows-latest
strategy:
matrix:
windows_config:
- python-version: "3.8"
- python-version: "3.9"
- python-version: "3.10"

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v3

# Set python version
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.windows_config.python-version }}

# Install Build Dependencies
- name: Install Build Dependencies
run: |
pip install poetry conan==1.59.0
# Configure conan for release build
- name: Build
run: |
export CONAN_SYSREQUIRES_SUDO=0
conan install deps/conanfile.txt -pr:b=default -pr:h=default -pr:h=deps/build.profile -s build_type=Release --build=* -if build
cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DPython_ROOT_DIR:STRING=/opt/python/$PYBIN -DPYTHON_EXECUTABLE:FILEPATH=/opt/python/$PYBIN/bin/python -S . -B build
cmake --build build --config Release
# Run the tests
- name: Test
run: |
export GTEST_FILTER=-*BlockObserverTest*:*SpriteObserverTest*
ctest --test-dir build_manylinux
# Setup python environment
- name: Poetry install
run: |
cd python
poetry install
# Run python tests
- name: Python tests
run: |
cd python
poetry run pytest .
- name: Python Package
run: |
cd python
poetry build --format=wheel
# Upload the built wheels
- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
path: python/dist/*.whl
Expand Down Expand Up @@ -160,15 +219,15 @@ jobs:
sudo apt-get install python3-pip
pip3 install poetry
- name: Pypi upload (test)
- name: Pypi publish (test)
if: contains(github.head_ref, 'release-test')
run: |
cd python
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.PYPI_TEST_TOKEN }}
poetry publish -r test-pypi
- name: Pypi upload (prod)
- name: Pypi publish (prod)
if: github.ref == 'refs/heads/master'
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
Expand Down

0 comments on commit 410cb3a

Please sign in to comment.