Merge pull request #61 from AllenNeuralDynamics/CICD_and_minor_updates #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tag and Publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-release: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' # Fetch all history to manage tags correctly | |
- name: Pull latest changes | |
run: git pull origin main | |
- name: Set up Python | |
uses: actions/setup-python@v2 # Corrected from checkout to setup-python | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine build | |
- name: Install project | |
run: pip install -e . # Install your project in editable mode | |
- name: Extract version from the package | |
id: get_version | |
run: | | |
echo "RELEASE_VERSION=$(python -c 'import parallax; print(parallax.__version__)')" >> $GITHUB_ENV | |
- 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: 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 }} |