Merge pull request #76 from AllenNeuralDynamics/wip/bundle-adjustment #24
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: 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 "hanna.lee@alleninstitute.org" | |
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 }} |