From 2f29ad24153adf06fea3087d1a562388088b199e Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 11:44:19 -0700 Subject: [PATCH 01/11] 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" -- 2.45.2 From 92a03355c33fa3da585527d69a91385013de65ea Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 12:42:57 -0700 Subject: [PATCH 02/11] 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 -- 2.45.2 From 2f4a9f980111773b7b973580f9a8316363caf7b6 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 12:45:10 -0700 Subject: [PATCH 03/11] 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: -- 2.45.2 From eb94a328c72f4c4475ba1a51d2101f1009d5af6f Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 12:48:56 -0700 Subject: [PATCH 04/11] 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 -- 2.45.2 From 9783e3f24e7677bd660f040ab743e813429b96e9 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Mon, 15 Apr 2024 13:30:31 -0700 Subject: [PATCH 05/11] 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: -- 2.45.2 From 9dbe34de88d29705e479fd73c7bcedc664db7014 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:01:15 -0700 Subject: [PATCH 06/11] 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 -- 2.45.2 From d0fe0c3f861b34e58c3d841b9f5acc5c26cfb93b Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:02:16 -0700 Subject: [PATCH 07/11] 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 -- 2.45.2 From eab19304e1919b01e11e95cb49236bd20dc79b06 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:07:26 -0700 Subject: [PATCH 08/11] 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 -- 2.45.2 From 5e04c480bdd2c485ab5fcc76ca0190c5fc6c3ae3 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:09:10 -0700 Subject: [PATCH 09/11] 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) -- 2.45.2 From 4367c2274de51ce970fec7aa966b807434922c06 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:30:06 -0700 Subject: [PATCH 10/11] 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: -- 2.45.2 From 329aa3927189aa1cfc926e7c4ec3bef4bcb5af40 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Tue, 16 Apr 2024 10:39:15 -0700 Subject: [PATCH 11/11] 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" -- 2.45.2