✨ feat(objects): add group taxon type feature fields to Project class #1595
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: Build and Package with Poetry (Feature) | |
on: | |
push: | |
paths: | |
- '**' | |
jobs: | |
build-and-publish-python-package: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Run image | |
uses: abatilo/actions-poetry@v4 | |
with: | |
poetry-version: "1.5.1" | |
- name: Increment version | |
run: | | |
BRANCH_NAME=$(echo $GITHUB_REF | sed 's/refs\/heads\///') | |
VERSION=$(poetry version --short) | |
MINOR_PATCH_PART=${VERSION#*.} | |
LAST_VERSION_PART_PREFIX=${MINOR_PATCH_PART%??} | |
PATCH_PART=${LAST_VERSION_PART_PREFIX%.*} | |
if [[ $BRANCH_NAME == "fix"* || $BRANCH_NAME == "bugs"* ]]; then | |
NEW_LATEST_PATCH_PART=$((PATCH_PART+1))b${GITHUB_RUN_ID} | |
elif [[ $BRANCH_NAME == "feature"* ]]; then | |
NEW_LATEST_PATCH_PART=$((PATCH_PART+1))a${GITHUB_RUN_ID} | |
elif [[ $BRANCH_NAME == "test"* ]]; then | |
NEW_LATEST_PATCH_PART=$((PATCH_PART+1))rc${GITHUB_RUN_ID} | |
elif [[ $BRANCH_NAME == "main"* || $BRANCH_NAME == "releases"* ]]; then | |
poetry version patch | |
VERSION=$(poetry version --short) | |
MINOR_PATCH_PART=${VERSION#*.} | |
LAST_VERSION_PART_PREFIX=${MINOR_PATCH_PART%??} | |
PATCH_PART=${LAST_VERSION_PART_PREFIX%.*} | |
NEW_LATEST_PATCH_PART=${PATCH_PART}${GITHUB_RUN_ID} | |
else | |
echo "Invalid branch name" | |
exit 1 | |
fi | |
NEW_VERSION=${VERSION%.*}.${NEW_LATEST_PATCH_PART} | |
echo $NEW_VERSION | |
echo "::set-output name=version::$NEW_VERSION" | |
echo "::set-output name=versionType::Release" | |
poetry version $NEW_VERSION --no-ansi | |
- name: Install dependencies | |
run: poetry install | |
- name: Test with pytest | |
run: | | |
poetry run pytest | |
- name: Build Package | |
run: | | |
poetry build | |
- name: Publish a Python distribution to PyPI | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
poetry publish | |
- name: Publish a Python distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
# - name: Release | |
# uses: softprops/action-gh-release@v2 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# tag_name: v${{ steps.version.outputs.version }} | |
# name: Release ${{ steps.version.outputs.version }} |