Skip to content

Commit

Permalink
implement poetry dynamic versioning (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Payne authored Dec 14, 2022
1 parent 433bee9 commit 551f872
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[tool.poetry]
name = "tap-messagebird"
version = "0.0.1"
version = "0.0.0"
description = "`tap-messagebird` is a Singer tap for Messagebird, built with the Meltano Singer SDK."
readme = "README.md"
authors = ["Meltano"]
keywords = [
"ELT",
Expand Down Expand Up @@ -34,9 +35,14 @@ multi_line_output = 3 # Vertical Hanging Indent
src_paths = "tap_messagebird"

[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
tap-messagebird = 'tap_messagebird.tap:TapMessagebird.cli'

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
4 changes: 3 additions & 1 deletion tap_messagebird/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
"""tap_messagebird init."""
"""`tap-messagebird` is a Singer tap for Messagebird, built with the Meltano Singer SDK."""

__version__ = "0.0.0"

0 comments on commit 551f872

Please sign in to comment.