Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
name: Publish to PyPI and GitHub Packages

on:
push:
tags:
- "v*.*.*"
release:
types: [published]

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}

- name: Set up Python
uses: actions/setup-python@v4

with:
python-version: "3.10"

- name: Install build tools

run: |
python -m pip install --upgrade pip setuptools wheel twine

Expand All @@ -34,14 +28,16 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GITHUB_TOKEN for publishing to GitHub Packages may not have sufficient permissions. Consider using a Personal Access Token (PAT) with 'packages:write' scope stored as a secret instead.

Suggested change
TWINE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
TWINE_PASSWORD: ${{ secrets.GITHUB_PACKAGES_PAT }}

Copilot uses AI. Check for mistakes.

run: |
twine upload \
--repository-url https://api.github.com/orgs/UCD-BDLab/packages/pypi/upload \
--repository-url https://upload.pypi.github.io/UCD-BDLab/BioNeuralNet \
Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub Packages repository URL appears to be incorrect. The correct format for GitHub Packages should be 'https://upload.pypi.org/legacy/' for PyPI or 'https://npm.pkg.github.com/OWNER/PACKAGE' for GitHub Packages. The current URL 'https://upload.pypi.github.io/UCD-BDLab/BioNeuralNet' does not match GitHub's documented endpoints.

Suggested change
--repository-url https://upload.pypi.github.io/UCD-BDLab/BioNeuralNet \
--repository-url https://upload.pypi.org/legacy/ \

Copilot uses AI. Check for mistakes.
dist/*

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

run: |
twine upload dist/*
Loading