From 05ced372b2805bdda5d2a04155f7e014c65a3657 Mon Sep 17 00:00:00 2001 From: Ken Payne Date: Thu, 8 Dec 2022 16:09:51 +0200 Subject: [PATCH] feat: add releases using poetry-dynamic-versioning (#8) --- .github/workflows/release_workflow.yml | 41 ++++++++++++++++++++++++++ pyproject.toml | 10 +++++-- target_snowflake/__init__.py | 3 ++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release_workflow.yml diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml new file mode 100644 index 0000000..801f997 --- /dev/null +++ b/.github/workflows/release_workflow.yml @@ -0,0 +1,41 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + build_deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + - name: Build package + run: | + poetry self add "poetry-dynamic-versioning[plugin]" + poetry config repositories.testpypi https://test.pypi.org/legacy/ + poetry dynamic-versioning --no-cache + poetry build + - name: Upload wheel to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/*.whl + tag: ${{ github.ref }} + overwrite: true + file_glob: true + - name: Deploy to PyPI + run: | + poetry publish -r testpypi -u "__token__" -p "${{ secrets.TEST_PYPI_TOKEN }}" + poetry publish -u "__token__" -p "${{ secrets.PYPI_TOKEN }}" diff --git a/pyproject.toml b/pyproject.toml index 951753d..3ce929f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,17 @@ [tool.poetry] name = "target-snowflake" -version = "0.0.1" +version = "0.0.0" description = "`target-snowflake` is a Singer target for Snowflake, built with the Meltano SDK for Singer Targets." +readme = "README.md" authors = ["Ken Payne"] keywords = [ "ELT", "Snowflake", ] license = "Apache 2.0" +packages = [ + { include = "target_snowflake" } +] [tool.poetry.dependencies] python = "<3.11,>=3.7.1" @@ -31,8 +35,8 @@ multi_line_output = 3 # Vertical Hanging Indent src_paths = "target_snowflake" [build-system] -requires = ["poetry-core>=1.0.8"] -build-backend = "poetry.core.masonry.api" +requires = ["poetry-core>=1.0.8", "poetry-dynamic-versioning"] +build-backend = "poetry_dynamic_versioning.backend" [tool.poetry.scripts] # CLI declaration diff --git a/target_snowflake/__init__.py b/target_snowflake/__init__.py index e69de29..f9d415b 100644 --- a/target_snowflake/__init__.py +++ b/target_snowflake/__init__.py @@ -0,0 +1,3 @@ +"""Singer.io Target for the Snowflake data warehouse platform.""" + +__version__ = "0.0.0"