From 64f8aac84e89878320ada72ab798bf8369c0094b Mon Sep 17 00:00:00 2001 From: Ken Payne Date: Thu, 5 Jan 2023 17:23:37 +0000 Subject: [PATCH] add poetry dynamic-versioning --- .github/workflows/release_workflow.yml | 41 ++++++++++++++++++++++++++ pyproject.toml | 24 +++++++++------ 2 files changed, 56 insertions(+), 9 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..51b1089 --- /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 }}" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0971cbb..ed13491 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,24 +1,30 @@ [tool.poetry] name = "target-singer-jsonl" -version = "0.1.0" -description = "" +version = "0.0.0" +description = "A Singer.io target for writing singer-formatted JSONL files to various destinations (e.g. local or s3)." authors = ["Ken Payne "] license = "MIT" readme = "README.md" packages = [{include = "target_singer_jsonl"}] +keywords = [ + "ELT", + "Singer.io", +] [tool.poetry.dependencies] python = "^3.10" jsonschema = "^4.17.3" smart-open = {extras = ["s3"], version = "^6.3.0"} -[tool.poetry.group.dev.dependencies] -tap-carbon-intensity = {git = "https://gitlab.com/meltano/tap-carbon-intensity.git"} +[tool.poetry.scripts] +# CLI declaration +target-singer-jsonl = 'target_singer_jsonl:main' [build-system] -requires = ["poetry-core"] -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 -target-singer-jsonl = 'target_singer_jsonl:main' \ No newline at end of file +[tool.poetry-dynamic-versioning] +enable = true +vcs = "git" +style = "semver" \ No newline at end of file