Skip to content

updating ants version and conda env #11

updating ants version and conda env

updating ants version and conda env #11

name: Tag and publish
on:
push:
branches:
- main
jobs:
bump-version-and-tag:
name: Bump version
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.output_version.outputs.new_version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
token: ${{ secrets.SERVICE_TOKEN }}
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.SERVICE_TOKEN }}
release_branches: main
default_bump: patch
- name: Get version file name set variables
run: |
pkg_name=$(grep -P 'version = \{attr = .*\}' pyproject.toml | grep -oP '\w+.__version__')
init_file="./code/${pkg_name//.__version__}/__init__.py"
echo "VERSION_FILE=$init_file" >> "$GITHUB_ENV"
echo "VERSION=${{ steps.tag_version.outputs.new_version }}" >> "$GITHUB_ENV"
- name: Update version file with new version
run: |
grep "__version__" "$VERSION_FILE"
sed -i --debug --expression="s|__version__.*|__version__ = \"${{ env.VERSION }}\"|" "$VERSION_FILE"
- name: Set output
id: output_version
run: echo "new_version=${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
- name: Commit and Push version bump
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "ci: version bump [skip actions]"
add: ${{ env.VERSION_FILE }}
# Uncomment the following step block to publish to PYPI.
# publish:
# needs: tag
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Pull latest changes
# run: git pull origin main
# - name: Set up Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8
# - name: Install dependencies
# run: |
# pip install --upgrade setuptools wheel twine build
# python -m build
# twine check dist/*
# - name: Publish on PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.AIND_PYPI_TOKEN }}