Skip to content

Commit

Permalink
Fix workflow
Browse files Browse the repository at this point in the history
fetch remote
  • Loading branch information
k1o0 committed Mar 6, 2024
1 parent 6057ce9 commit eb488c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and check version
pip install --editable .
pip install packaging
- name: Fetch versions
run: |
git fetch origin --tags
previous_version=$(git describe --tags --match="[0-9]*" origin/main)
latest_version=$(pip show project_extraction | awk '/^Version: / {sub("^Version: ", ""); print}')
echo "Version tag on main: $previous_version"
echo "Version tag on this branch: $latest_version"
echo "PREVIOUS_VERSION=$previous_version" >> $GITHUB_ENV
echo "LATEST_VERSION=latest_version" >> $GITHUB_ENV
- name: Assert version
run: |
git fetch --tags
python setup.py sdist bdist_wheel
current=$(git describe --tags --match="[0-9]*" HEAD)
new=$(pip show ibllib | awk '/^Version: / {sub("^Version: ", ""); print}')
python <<EOP
import sys; from packaging import version
sys.exit(int(version.parse("$current") >= version.parse("$new")))
sys.exit(int(version.parse("$PREVIOUS_VERSION") >= version.parse("$LATEST_VERSION")))
EOP
RC=$?
echo "Exit code $RC"
- name: Push tag
run: |
git tag -a "$new" HEAD
git tag -a "$new" HEAD -m "Version v$new"
git push origin "$new"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "project_extraction"
version = "0.2.1"
version = "0.2.1.post0"
description = "Custom extractors for satellite tasks"
dynamic = [ "readme" ]
keywords = [ "IBL", "neuro-science" ]
Expand Down

0 comments on commit eb488c4

Please sign in to comment.