From cdca3edde9b75d23e4008c8605df9b88c9936453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Alexandre=20C=C3=B4t=C3=A9?= Date: Tue, 1 Oct 2024 13:32:31 -0400 Subject: [PATCH] Update Github Action for prerelease --- .github/workflows/prerelease.yml | 46 +++++++++++++++++++++++++++++++- textworld/version.py | 2 +- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3f56554e..757d79dd 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -24,7 +24,51 @@ jobs: pip install build - name: Build package run: python -m build - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: dist/* if-no-files-found: error + + release: + name: >- + Publish TextWorld 📦 to PyPI + needs: build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/textworld/ + permissions: + id-token: write # mandatory for trusted publishing + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + path: dist/* + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + test: + needs: release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + python: ['3.9', '3.10', '3.11', '3.12'] + steps: + - uses: actions/checkout@v3 + - name: Use Python ${{ matrix.python }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-azurepipelines pytest-cov + pip install --pre textworld[full] + - name: Run tests + run: | + pytest --durations=10 --junitxml=junit/test-results.xml --cov=textworld --cov-report=xml --cov-report=html tests/ textworld/ + - uses: actions/upload-artifact@v2 + with: + name: test-results + path: junit/test-results.xml diff --git a/textworld/version.py b/textworld/version.py index 1ac3197d..dd74ba88 100644 --- a/textworld/version.py +++ b/textworld/version.py @@ -1 +1 @@ -__version__ = '1.6.2rc1' +__version__ = '1.6.2rc2'