diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..67eebfa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + publish-to-pypi: + needs: + - build + name: Publish Python 🐍 distribution 📦 to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/dbt-conveyor-snowflake + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml new file mode 100644 index 0000000..50bd0f8 --- /dev/null +++ b/.github/workflows/test-release.yml @@ -0,0 +1,51 @@ +name: Test Release + +on: + push: + branches: + - main + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + publish-to-testpypi: + needs: + - build + name: Publish Python 🐍 distribution 📦 to TestPyPI + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/dbt-conveyor-snowflake + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/setup.py b/setup.py index 71ea372..635ccd6 100644 --- a/setup.py +++ b/setup.py @@ -1,23 +1,30 @@ #!/usr/bin/env python from setuptools import find_namespace_packages, setup -package_name = "dbt-conveyorsnowflake" +package_name = "dbt-conveyor-snowflake" # make sure this always matches dbt/adapters/{adapter}/__version__.py -package_version = "1.7.0" description = """The ConveyorSnowflake adapter plugin for dbt""" setup( name=package_name, - version=package_version, description=description, + setuptools_git_versioning={ + "enabled": True, + }, long_description=description, author="Stijn De Haes", author_email="stijn.dehaes@dataminded.be", - url="If you have already made a github repo to tie the project to place it here, otherwise update in setup.py later.", + url="https://github.com/datamindedbe/dbt-conveyor-snowflake", + classifiers=[ + "Development Status :: 3 - Alpha", + "Operating System :: OS Independent", + "Programming Language :: Python", + ], packages=find_namespace_packages(include=["dbt", "dbt.*"]), include_package_data=True, install_requires=[ "dbt-core~=1.7.0", "dbt-snowflake~=1.7.0", ], + setup_requires=["setuptools-git-versioning<2"], )