From 2f29ad24153adf06fea3087d1a562388088b199e Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 11:44:19 -0700 Subject: [PATCH 01/12] ci: add pipeline --- .woodpecker.yml | 39 +++++++++++++++++++++++++++++++++++++++ build | 2 +- music_kraken/__init__.py | 2 -- pyproject.toml | 9 +++++++-- 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..61abc42 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,39 @@ +labels: + platform: linux/amd64 + +steps: + build: + image: python + commands: + - python -m pip install -r requirements-dev.txt + - python3 -m build + environment: + - SETUPTOOLS_SCM_PRETEND_VERSION=${CI_COMMIT_TAG} + when: + - event: tag + + build-dev: + image: python + commands: + - sed -i 's/name = "music-kraken"/name = "music-kraken-unstable"/' pyproject.toml + - python -m pip install -r requirements-dev.txt + - python3 -m build + when: + - event: manual + - event: push + branch: experimental + + publish-gitea: + image: plugins/pypi + settings: + skip_build: true + repository: "https://gitea.elara.ws/api/packages/music-kraken/pypi" + username: + from_secret: gitea-username + password: + from_secret: gitea-password + when: + - event: manual + - event: tag + - event: push + branch: experimental diff --git a/build b/build index 0b600cf..4bb9c07 100755 --- a/build +++ b/build @@ -45,4 +45,4 @@ then exit fi -twine upload dist/music_kraken* +twine upload dist/music_kraken* diff --git a/music_kraken/__init__.py b/music_kraken/__init__.py index 73dbbf1..a787571 100644 --- a/music_kraken/__init__.py +++ b/music_kraken/__init__.py @@ -9,8 +9,6 @@ from rich.console import Console from .utils.shared import DEBUG, DEBUG_LOGGING from .utils.config import logging_settings, main_settings, read_config -__version__ = "1.15.0" - read_config() console: Console = Console() diff --git a/pyproject.toml b/pyproject.toml index 3ac5165..0ce6636 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling", "hatch-requirements-txt" ] +requires = ["hatchling", "hatch-requirements-txt", "hatch-vcs"] build-backend = "hatchling.build" [tool.hatch.build] @@ -15,7 +15,12 @@ packages = ["music_kraken"] music-kraken = "music_kraken.__main__:cli" [tool.hatch.version] -path = "music_kraken/__init__.py" +source = "vcs" +path = "music_kraken/_version.py" +fallback-version = "0.0.0" + +[tool.hatch.build.hooks.vcs] +version-file = "music_kraken/_version.py" [project] name = "music-kraken" From 92a03355c33fa3da585527d69a91385013de65ea Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 12:42:57 -0700 Subject: [PATCH 02/12] ci: add _version.py to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index faa641c..9c40952 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ venv windows .env + +# setuptools_scm +_version.py From 2f4a9f980111773b7b973580f9a8316363caf7b6 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 12:45:10 -0700 Subject: [PATCH 03/12] ci: remove unstable suffix from experimental and add stable suffix to tagged builds --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 61abc42..0abf9e2 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,6 +5,7 @@ steps: build: image: python commands: + - sed -i 's/name = "music-kraken"/name = "music-kraken-stable"/' pyproject.toml - python -m pip install -r requirements-dev.txt - python3 -m build environment: @@ -15,7 +16,6 @@ steps: build-dev: image: python commands: - - sed -i 's/name = "music-kraken"/name = "music-kraken-unstable"/' pyproject.toml - python -m pip install -r requirements-dev.txt - python3 -m build when: From eb94a328c72f4c4475ba1a51d2101f1009d5af6f Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 12:48:56 -0700 Subject: [PATCH 04/12] ci: fix secret names --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 0abf9e2..fe88614 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -29,9 +29,9 @@ steps: skip_build: true repository: "https://gitea.elara.ws/api/packages/music-kraken/pypi" username: - from_secret: gitea-username + from_secret: gitea_username password: - from_secret: gitea-password + from_secret: gitea_password when: - event: manual - event: tag From 9783e3f24e7677bd660f040ab743e813429b96e9 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 13:30:31 -0700 Subject: [PATCH 05/12] ci: use new twine plugin --- .woodpecker.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index fe88614..3b0c9fb 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -24,10 +24,9 @@ steps: branch: experimental publish-gitea: - image: plugins/pypi + image: gitea.elara.ws/music-kraken/plugin-twine settings: - skip_build: true - repository: "https://gitea.elara.ws/api/packages/music-kraken/pypi" + repository_url: "https://gitea.elara.ws/api/packages/music-kraken/pypi" username: from_secret: gitea_username password: From 9dbe34de88d29705e479fd73c7bcedc664db7014 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:01:15 -0700 Subject: [PATCH 06/12] ci: publish to pypi --- .woodpecker.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 3b0c9fb..543029a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -36,3 +36,16 @@ steps: - event: tag - event: push branch: experimental + + publish-pypi: + image: gitea.elara.ws/music-kraken/plugin-twine + settings: + username: + from_secret: pypi_username + password: + from_secret: pypi_password + when: + - event: manual + - event: tag + - event: push + branch: experimental From d0fe0c3f861b34e58c3d841b9f5acc5c26cfb93b Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:02:16 -0700 Subject: [PATCH 07/12] ci: fix indentation --- .woodpecker.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 543029a..36e1589 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -37,15 +37,15 @@ steps: - event: push branch: experimental - publish-pypi: - image: gitea.elara.ws/music-kraken/plugin-twine - settings: - username: - from_secret: pypi_username - password: - from_secret: pypi_password - when: - - event: manual - - event: tag - - event: push - branch: experimental + publish-pypi: + image: gitea.elara.ws/music-kraken/plugin-twine + settings: + username: + from_secret: pypi_username + password: + from_secret: pypi_password + when: + - event: manual + - event: tag + - event: push + branch: experimental From eab19304e1919b01e11e95cb49236bd20dc79b06 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:07:26 -0700 Subject: [PATCH 08/12] ci: make step names more clear --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 36e1589..843b555 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -2,7 +2,7 @@ labels: platform: linux/amd64 steps: - build: + build-stable: image: python commands: - sed -i 's/name = "music-kraken"/name = "music-kraken-stable"/' pyproject.toml From 5e04c480bdd2c485ab5fcc76ca0190c5fc6c3ae3 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:09:10 -0700 Subject: [PATCH 09/12] docs: add readme status badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6174576..bc14167 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Music Kraken +[![Woodpecker CI Status](https://ci.elara.ws/api/badges/59/status.svg)](https://ci.elara.ws/repos/59) + music kraken logo - [Music Kraken](#music-kraken) From 4367c2274de51ce970fec7aa966b807434922c06 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:30:06 -0700 Subject: [PATCH 10/12] ci: change version format because pypi won't allow local versions --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 843b555..5f822cd 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -16,6 +16,7 @@ steps: build-dev: image: python commands: + - export SETUPTOOLS_SCM_PRETEND_VERSION="$(git describe --abbrev=0 --tags).dev$(git rev-list "$(git describe --abbrev=0 --tags)..HEAD" --count)" - python -m pip install -r requirements-dev.txt - python3 -m build when: From 329aa3927189aa1cfc926e7c4ec3bef4bcb5af40 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:39:15 -0700 Subject: [PATCH 11/12] ci: disable local version in config --- .woodpecker.yml | 1 - pyproject.toml | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 5f822cd..843b555 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -16,7 +16,6 @@ steps: build-dev: image: python commands: - - export SETUPTOOLS_SCM_PRETEND_VERSION="$(git describe --abbrev=0 --tags).dev$(git rev-list "$(git describe --abbrev=0 --tags)..HEAD" --count)" - python -m pip install -r requirements-dev.txt - python3 -m build when: diff --git a/pyproject.toml b/pyproject.toml index 0ce6636..5fab835 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,9 @@ source = "vcs" path = "music_kraken/_version.py" fallback-version = "0.0.0" +[tool.hatch.version.raw-options] +local_scheme = "no-local-version" + [tool.hatch.build.hooks.vcs] version-file = "music_kraken/_version.py" From e47e22428d85e2b422e6fa9491b4032aecd5593d Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 11:07:27 -0700 Subject: [PATCH 12/12] ci: force tags to be fetched --- .woodpecker.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 843b555..f751a41 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,7 +1,13 @@ labels: platform: linux/amd64 -steps: +clone: + git: + image: woodpeckerci/plugin-git + settings: + tags: true + +steps: build-stable: image: python commands: