From cd1d5aa84e1f6c916c3eccd107161646fba2c764 Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Fri, 8 Mar 2024 22:44:08 +0100 Subject: [PATCH] improved the build and upload --- Makefile | 4 ++-- pyproject.toml | 3 ++- upload.sh | 12 ++---------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 2f3f480..f1c162e 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,11 @@ docs: format clean-dist: rm -rf dist -hatch-release: +hatch-release: clean-dist hatch build galaxy-release: clean-dist changelog - ansible-galaxy collection build --output-path dist + ansible-galaxy collection build --output-path dist/galaxy upload: galaxy-release hatch-release ./upload.sh diff --git a/pyproject.toml b/pyproject.toml index f4c2199..1be90fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,8 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [] - +[tool.hatch.build] +directory = "dist/python" [project.urls] Documentation = "https://github.com/unknown/ansible-module#readme" Issues = "https://github.com/unknown/ansible-module/issues" diff --git a/upload.sh b/upload.sh index 5fad7ad..e3835b8 100755 --- a/upload.sh +++ b/upload.sh @@ -3,13 +3,5 @@ user=$(yq -r .namespace galaxy.yml) package=$(yq -r .name galaxy.yml) version=$(yq -r .version galaxy.yml) printf "Namespace: %s\nPackage: %s\nVersion: %s\n" $user $package $version -upload(){ - name=$(basename "$1") - printf "uploading: %s as %s\n" "$1" "$name" - curl -u sebastian --upload-file "$1" "https://gitea.sebastian-tobie.de/api/packages/ansible/generic/${package}/${version}/$name" -} -for file in dist/sebastian* ; do - upload "$file" -done -rm -f dist/sebastian* -hatch publish -r ansible +ansible-galaxy collection publish dist/galaxy/* +hatch publish -r ansible dist/python/*