Skip to content

Merge pull request #110 from AllenNeuralDynamics/wip/pytest #54

Merge pull request #110 from AllenNeuralDynamics/wip/pytest

Merge pull request #110 from AllenNeuralDynamics/wip/pytest #54

name: Tag and Publish
on:
push:
branches:
- main
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Extract version from the package
id: get_version
shell: bash
run: |
RELEASE_VERSION=$(python -c 'import parallax; print(parallax.__version__)')
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Extracted RELEASE_VERSION: $RELEASE_VERSION"
- name: Configure Git Account
run: |
git config --local user.email "[email protected]"
git config --local user.name "Hanna"
- name: Create Git tag
run: |
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
git push origin ${{ env.RELEASE_VERSION }}
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
draft: false
prerelease: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Install project
run: pip install -e .
- name: Build package
run: |
python -m build
twine check dist/*
- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.AIND_PYPI_TOKEN }}
# Job 2: Build Documentation for Pushes to Main
build-docs:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
# Step 3: Install dependencies (including Sphinx)
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
# Step 4: Build the documentation
- name: Build Documentation
run: |
sphinx-build -b html docs/source docs/_build
# Fail the workflow if documentation build fails
continue-on-error: false