From d030c20dffee06c8f0183b91685ad4af58d1c25f Mon Sep 17 00:00:00 2001 From: tegwick Date: Sun, 12 Jul 2026 00:42:52 +0200 Subject: [PATCH] feat(ci): add Forgejo PyPI publish workflow and make target Adds publish-forgejo and a workflow_dispatch/tag workflow so issue-core 0.2.x can be published to forgejo.coulomb.social before vergabe-teilnahme drops Gitea lockfile URLs. --- .forgejo/workflows/publish-python-package.yml | 41 +++++++++++++++++++ Makefile | 11 +++++ 2 files changed, 52 insertions(+) create mode 100644 .forgejo/workflows/publish-python-package.yml diff --git a/.forgejo/workflows/publish-python-package.yml b/.forgejo/workflows/publish-python-package.yml new file mode 100644 index 0000000..08f41c9 --- /dev/null +++ b/.forgejo/workflows/publish-python-package.yml @@ -0,0 +1,41 @@ +name: Publish Python package + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Fetch source archive + env: + REF: ${{ github.sha }} + run: | + set -eu + mkdir -p buildctx + wget -qO /tmp/repo.tar.gz \ + "https://forgejo.coulomb.social/${GITHUB_REPOSITORY}/archive/${REF}.tar.gz" + tar xzf /tmp/repo.tar.gz -C buildctx --strip-components=1 + + - name: Set up Python + run: | + python3 -m pip install --upgrade pip build twine + + - name: Build and validate distributions + working-directory: buildctx + run: | + python3 -m build + python3 -m twine check dist/* + + - name: Upload to Forgejo PyPI + working-directory: buildctx + env: + TWINE_USERNAME: ${{ secrets.FORGEJO_PYPI_USER }} + TWINE_PASSWORD: ${{ secrets.FORGEJO_PYPI_TOKEN }} + run: >- + python3 -m twine upload + --repository-url https://forgejo.coulomb.social/api/packages/coulomb/pypi + dist/* \ No newline at end of file diff --git a/Makefile b/Makefile index f558e68..8e9120b 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,7 @@ ISSUE_CLI := $(shell command -v issue 2> /dev/null) PYTHON ?= python3 GITEA_PACKAGE_OWNER ?= coulomb GITEA_PYPI_REPOSITORY_URL ?= https://gitea.coulomb.social/api/packages/$(GITEA_PACKAGE_OWNER)/pypi +FORGEJO_PYPI_REPOSITORY_URL ?= https://forgejo.coulomb.social/api/packages/$(GITEA_PACKAGE_OWNER)/pypi # Core Issue Operations .PHONY: issue-list @@ -238,6 +239,16 @@ ifndef TWINE_PASSWORD endif $(PYTHON) -m twine upload --repository-url "$(GITEA_PYPI_REPOSITORY_URL)" dist/* +.PHONY: publish-forgejo +publish-forgejo: package-check ## Publish distributions to the Coulomb Forgejo PyPI registry +ifndef TWINE_USERNAME + $(error TWINE_USERNAME is required) +endif +ifndef TWINE_PASSWORD + $(error TWINE_PASSWORD is required) +endif + $(PYTHON) -m twine upload --repository-url "$(FORGEJO_PYPI_REPOSITORY_URL)" dist/* + # Feedback and Continuous Improvement .PHONY: feedback feedback: ## Submit feedback (Usage: make feedback MSG="your feedback")