Skip to content

Commit

Permalink
fix ci versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Apr 14, 2023
1 parent 42fb189 commit d68273c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 deletions.
22 changes: 0 additions & 22 deletions .bumpversion.cfg

This file was deleted.

19 changes: 17 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ jobs:
- name: set version
id: set-version
run: |
VERSION=$(sed -n '0,/package_version = \(.*\)/s//\1/p' setup.py | tr -d '"' )
VERSION=$(sed -n '0,/version = \(.*\)/s//\1/p' dbt/adapters/iris/__version__.py | tr -d '"' )
[ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=b$(($(git tag -l "v${VERSION}b*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d b -f2)+1))
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }}
echo "version=$VERSION" >> $GITHUB_OUTPUT
sed -i "s/package_version = .*/package_version = \"${VERSION}\"/" setup.py
sed -i "s/version = .*/version = \"${VERSION}\"/" dbt/adapters/iris/__version__.py
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -171,3 +171,18 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v3
if: github.event_name == 'release'
with:
ref: main
- name: Bump version
if: github.event_name == 'release'
run: |
git config --global user.name 'ProjectBot'
git config --global user.email '[email protected]'
VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
VERSION=`echo $VERSION | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
sed -i "s/version = .*/version = \"${VERSION}\"/" dbt/adapters/iris/__version__.py
git add dbt/adapters/iris/__version__.py
git commit -m 'auto bump version with release'
git push
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ target/
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/iris/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.3.1.1"
version = "1.3.4"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from setuptools import find_namespace_packages, setup
import os

from dbt.adapters.iris.__version__ import version as package_version

package_name = "dbt-iris"
# make sure this always matches dbt/adapters/{adapter}/__version__.py
package_version = "1.3.2"
description = """The InterSystems IRIS adapter plugin for dbt"""

thelibFolder = os.path.dirname(os.path.realpath(__file__))
Expand Down

0 comments on commit d68273c

Please sign in to comment.