Skip to content

Commit

Permalink
Added publishing to pypi (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
stijndehaes authored Jan 10, 2024
1 parent cdce01c commit 089485c
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 4 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -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/
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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="[email protected]",
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"],
)

0 comments on commit 089485c

Please sign in to comment.