Skip to content

Commit

Permalink
Update Github Action for prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcCote committed Oct 1, 2024
1 parent 9018e21 commit 6bd1988
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 5 deletions.
78 changes: 74 additions & 4 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on:
workflow_dispatch:

jobs:
build:
build_wheels:
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
- uses: actions/checkout@v4
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
Expand All @@ -24,7 +24,77 @@ jobs:
pip install build
- name: Build package
run: python -m build
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: tw-wheels-${{ matrix.os }}-${{ matrix.python }}
path: dist/*
if-no-files-found: error

# Build the source distribution under Linux
build_sdist:
name: Source distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build --sdist
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: tw-sdist
path: dist/*.tar.gz

release:
name: >-
Publish TextWorld 📦 to PyPI
needs:
- build_wheels
- build_sdist
runs-on: ubuntu-latest
environment:
name: prerelease
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:
pattern: tw-*
path: dist
merge-multiple: true
- 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@v4
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v5
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
2 changes: 1 addition & 1 deletion textworld/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.6.2rc1'
__version__ = '1.6.2rc2'

0 comments on commit 6bd1988

Please sign in to comment.