From 1a7783630db5b1326d7469e2f7daff99cb980ca0 Mon Sep 17 00:00:00 2001 From: Pymetheus Date: Tue, 6 Jan 2026 23:36:36 +0100 Subject: [PATCH] chore: test publishing to TestPyPI and GitHub Releases Temporarily replace placeholders to validate the TestPyPI publish step and GitHub release workflow. --- .github/workflows/cd.yml | 114 +++++++++++++++++++-------------------- pyproject.toml | 6 +-- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a548d4a..ba6f12c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -43,60 +43,60 @@ jobs: exit 1 fi -# publish-test-pypi: -# name: Publish to TestPyPI -# runs-on: ubuntu-latest -# needs: download-distribution -# -# environment: -# name: testpypi -# url: https://test.pypi.org/p/unicorn_package_name # Replace with your package name -# -# steps: -# - name: Download build artifacts -# uses: actions/download-artifact@v7 -# with: -# name: python-package-distributions-${{ github.event.workflow_run.head_sha }} -# path: dist/ -# run-id: ${{ github.event.workflow_run.id }} -# github-token: ${{ secrets.GITHUB_TOKEN }} -# -# - name: Publish to TestPyPI -# uses: pypa/gh-action-pypi-publish@release/v1 -# with: -# repository-url: https://test.pypi.org/legacy/ -# packages-dir: dist/ -# skip-existing: true -# verbose: true -# -# github-release: -# name: Create GitHub Release -# runs-on: ubuntu-latest -# needs: [download-distribution, publish-test-pypi] # [download-distribution, publish-test-pypi] -# -# steps: -# - name: Checkout code -# uses: actions/checkout@v6 -# -# - name: Download build artifacts -# uses: actions/download-artifact@v7 -# with: -# name: python-package-distributions-${{ github.event.workflow_run.head_sha }} -# path: dist/ -# run-id: ${{ github.event.workflow_run.id }} -# github-token: ${{ secrets.GITHUB_TOKEN }} -# -# - name: Extract version -# id: meta -# run: | -# VERSION=$(grep '^version =' pyproject.toml | sed 's/version = "\(.*\)"/\1/') -# echo "version=$VERSION" >> $GITHUB_OUTPUT -# -# - name: Create GitHub release -# uses: softprops/action-gh-release@v2 -# with: -# files: dist/* -# tag_name: v${{ steps.meta.outputs.version }} -# generate_release_notes: true -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish-test-pypi: + name: Publish to TestPyPI + runs-on: ubuntu-latest + needs: download-distribution + + environment: + name: testpypi + url: https://test.pypi.org/p/python_project_blueprint # Replace with your package name + + steps: + - name: Download build artifacts + uses: actions/download-artifact@v7 + with: + name: python-package-distributions-${{ github.event.workflow_run.head_sha }} + path: dist/ + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + packages-dir: dist/ + skip-existing: true + verbose: true + + github-release: + name: Create GitHub Release + runs-on: ubuntu-latest + needs: [download-distribution, publish-test-pypi] + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Download build artifacts + uses: actions/download-artifact@v7 + with: + name: python-package-distributions-${{ github.event.workflow_run.head_sha }} + path: dist/ + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract version + id: meta + run: | + VERSION=$(grep '^version =' pyproject.toml | sed 's/version = "\(.*\)"/\1/') + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Create GitHub release + uses: softprops/action-gh-release@v2 + with: + files: dist/* + tag_name: v${{ steps.meta.outputs.version }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 116656c..b79d863 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [project] name = "python-project-blueprint" version = "0.0.1" -description = "[[DESCRIPTION]]" +description = "Production-ready Python project template with modern tooling, CI/CD, security, and configuration built in." readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.12" license = {"file" = "LICENSE.md"} authors = [ - { name = "[[USERNAME]]", email = "AUTHOR@EXAMPLE.COM" } + { name = "Pymetheus", email = "github.senate902@passfwd.com" } ] classifiers = [ @@ -32,7 +32,7 @@ dev = [ [project.urls] Homepage = "https://github.com/Pymetheus/python-project-blueprint" # "https://github.com/[[USERNAME]]/[[REPO_NAME]]" Repository = "https://github.com/Pymetheus/python-project-blueprint" # "https://github.com/[[USERNAME]]/[[REPO_NAME]]" -Documentation = "https://github.com/Pymetheus/python-project-blueprint/blob/main/docs/DOCUMENTATION.md" # "https://github.com/[[USERNAME]]/[[REPO_NAME]]/blob/main/docs/DOCUMENTATION.md" +Documentation = "https://github.com/Pymetheus/python-project-blueprint/blob/main/docs/INSTRUCTIONS.md" # "https://github.com/[[USERNAME]]/[[REPO_NAME]]/blob/main/docs/DOCUMENTATION.md" Issues = "https://github.com/Pymetheus/python-project-blueprint/issues" # "https://github.com/[[USERNAME]]/[[REPO_NAME]]/issues" [project.scripts]