Skip to content

publish-releases

publish-releases #3

Workflow file for this run

name: publish-releases
on:
release:
types: [published]
jobs:
build-source-dist:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
python -m pip install build
- name: Build the package
run: python -m build
- name: Upload source distribution
uses: actions/upload-artifact@v3
with:
name: "apollon-sdist-tgz"
path: dist/*.tar.gz
build-macos:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
python -m pip install build
- name: Build the package
run: python -m build
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{ format('apollon-macos-{0}', matrix.python-version) }}
path: dist/*.whl
build-windows:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
python -m pip install build
- name: Build the package
run: python -m build
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{ format('apollon-windows-{0}', matrix.python-version) }}
path: dist/*.whl
pypi-publish:
name: Upload releases to PyPI
needs: [build-windows, build-macos, build-source-dist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/apollon
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Retrieve all artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Prepare artifacts
run: |
mkdir ./dist
cp ./artifacts/**/*.{whl,tar.gz} ./dist
- name: Upload files
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8