Skip to content

2024.09.09

2024.09.09 #44

Workflow file for this run

name: Release
on:
release:
types:
- created
push:
branches:
- main
tags:
- "*"
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.11, 3.12]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: pip install .[all]
- name: Run tests
run: |
pbs-install 3.10 -d test1 -v
version=$(test1/bin/python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
[[ $version == "3.10" ]] || exit 1
- name: Run tests with build
run: |
pbs-install 3.10 -d test2 -v --build-dir
version=$(test2/install/bin/python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
[[ $version == "3.10" ]] || exit 1
release:
name: Build and Release
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'repository_dispatch'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
- name: Build
run: pipx run build
- name: Upload to Pypi
run: |
pipx run twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*