Skip to content

reconfigure read the docs to fix the build issues #29

reconfigure read the docs to fix the build issues

reconfigure read the docs to fix the build issues #29

Workflow file for this run

name: Tests, Package, and Deployment
on:
workflow_dispatch:
pull_request:
push:
branches: [next, qa, master]
tags: ["v*"]
env:
PKG_NAME: pystog
jobs:
tests:
name: Run Test Suite
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pixi
uses: prefix-dev/[email protected]
- name: Unit test with code coverage
run: pixi run test -vv --cov=${{ env.PKG_NAME }} --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }} # required
build-conda:
name: Build conda package
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true
ref: ${{ github.ref }}
- name: Setup Pixi
uses: prefix-dev/[email protected]
- name: Build Conda package
run: |
pixi run conda-build
mkdir -p /tmp/local-channel/linux-64
cp *.conda /tmp/local-channel/linux-64
- name: Verify conda package
uses: neutrons/conda-verify@main
with:
package-name: ${{ env.PKG_NAME }}
local-channel: /tmp/local-channel
python-version: "3.10"
- name: Upload conda package as artifact
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/v')
with:
name: artifact-conda-package
path: ${{ env.PKG_NAME }}-*.conda
publish-conda:
name: Publish to Anaconda
runs-on: ubuntu-24.04
needs: [tests, build-conda]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true
ref: ${{ github.ref }}
- name: Setup Pixi
uses: prefix-dev/[email protected]
- name: Download conda package artifact
uses: actions/download-artifact@v5
with:
name: artifact-conda-package
- name: Upload package to anaconda
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
IS_RC: ${{ contains(github.ref, 'rc') }}
run: |
# label is main or rc depending on the tag-name
CONDA_LABEL="main"
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
pixi run anaconda upload --label $CONDA_LABEL --user neutrons ${{ env.PKG_NAME }}-*.conda
pypi-package:
name: Build and Publish PyPI package
runs-on: ubuntu-latest
needs: tests
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
manifest-path: pyproject.toml
- name: Build pypi package
run: |
VERSION=$(pixi run -- versioningit .)
pixi run pypi-build
# publish your distributions here (need to setup on PyPI first)
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1