From 01443d7e9ee41559bb8d46f856bf747aca90ce81 Mon Sep 17 00:00:00 2001 From: Derek Visch Date: Thu, 22 Feb 2024 13:27:09 -0500 Subject: [PATCH 1/5] release workflow --- .github/workflows/release_workflow.yml | 41 ++++++++++++++++++++++++++ pyproject.toml | 32 ++++++++++++++++---- 2 files changed, 68 insertions(+), 5 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..8a4ba21 --- /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@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + 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.POSTGRES_PYPI_TOKEN }}" diff --git a/pyproject.toml b/pyproject.toml index 2734edf..7db424b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,36 @@ [tool.poetry] -name = "tap-mysql" -version = "0.0.1" +name = "meltanolabs-tap-mysql" +version = "0.0.0" description = "`tap-mysql` is a Singer tap for mysql, built with the Meltano Singer SDK." +authors = ["Meltano Team and Contributors "] +maintainers = ["Meltano Team and Contributors "] +license = "MIT" readme = "README.md" -authors = ["AutoIDM"] +homepage = "https://meltano.com" +repository = "https://github.com/meltanolabs/tap-mysql" keywords = [ + "MySQL", + "Vitess", + "PlanetScale", + "Singer", "ELT", - "mysql", + "Meltano", + "Meltano SDK", +] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: CPython", +] +packages = [ + { include = "tap_mysql" } ] -license = "Apache-2.0" [tool.poetry.dependencies] python = ">=3.8" From e76d9e1b75b2d858a666ef196b6ca22aaafed5dc Mon Sep 17 00:00:00 2001 From: Derek Visch Date: Fri, 23 Feb 2024 10:46:58 -0500 Subject: [PATCH 2/5] Hopefully fixed the release workflow --- .github/workflows/release_workflow.yml | 51 +++++++++++++------------- pyproject.toml | 9 ++++- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index 8a4ba21..683d6cf 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -1,41 +1,40 @@ -name: Upload Python Package +name: Build and publish on: - release: - types: [created] + push: jobs: - build_deploy: - + build: + name: Build wheel and sdist runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v5 + ref: ${{ github.ref }} + - uses: hynek/build-and-inspect-python-package@v2 + + publish: + name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + environment: + name: publishing + url: https://pypi.org/p/meltanolabs-tap-mysql + needs: build + permissions: + contents: write + id-token: write + + steps: + - uses: actions/download-artifact@v4 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 + name: Packages + path: dist + - 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.POSTGRES_PYPI_TOKEN }}" + - uses: pypa/gh-action-pypi-publish@v1.8.11 diff --git a/pyproject.toml b/pyproject.toml index 7db424b..2a9145f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,9 +93,14 @@ known-first-party = ["tap_mysql"] convention = "google" [build-system] -requires = ["poetry-core==1.9.0"] -build-backend = "poetry.core.masonry.api" +requires = ["poetry-core==1.8.1", "poetry-dynamic-versioning"] +build-backend = "poetry_dynamic_versioning.backend" [tool.poetry.scripts] # CLI declaration tap-mysql = 'tap_mysql.tap:TapMySQL.cli' + +[tool.poetry-dynamic-versioning] +enable = true +vcs = "git" +style = "semver" From aef03c64a5d8b91ebc5746f990a56e905f003260 Mon Sep 17 00:00:00 2001 From: Derek Visch Date: Fri, 23 Feb 2024 11:18:15 -0500 Subject: [PATCH 3/5] Update .github/workflows/release_workflow.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com> --- .github/workflows/release_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index 683d6cf..69e9411 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -19,7 +19,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest environment: - name: publishing + name: pypi url: https://pypi.org/p/meltanolabs-tap-mysql needs: build permissions: From 54b007b7a242abf75b55efd8aa91315e9633cc89 Mon Sep 17 00:00:00 2001 From: Derek Visch Date: Fri, 23 Feb 2024 11:19:43 -0500 Subject: [PATCH 4/5] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2a9145f..e0310cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,7 @@ known-first-party = ["tap_mysql"] convention = "google" [build-system] -requires = ["poetry-core==1.8.1", "poetry-dynamic-versioning"] +requires = ["poetry-core==1.9.0", "poetry-dynamic-versioning"] build-backend = "poetry_dynamic_versioning.backend" [tool.poetry.scripts] From 464eced822657839c514c139bf52fb17b5f02b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Fri, 23 Feb 2024 11:08:51 -0600 Subject: [PATCH 5/5] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e0310cb..9767f2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,4 +103,4 @@ tap-mysql = 'tap_mysql.tap:TapMySQL.cli' [tool.poetry-dynamic-versioning] enable = true vcs = "git" -style = "semver" +style = "pep440"