Skip to content

Commit 353f2e0

Browse files
feanilclaude
andcommitted
feat: Publish tutor plugin to PyPI on release
Renames the package to tutor-contrib-sample-plugin following the convention for Tutor community plugins. The tutor plugin shares the version determined by the backend's python-semantic-release run, passed via SETUPTOOLS_SCM_PRETEND_VERSION at build time. It is published to PyPI in a parallel job alongside the backend package. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d4f30d8 commit 353f2e0

2 files changed

Lines changed: 44 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,31 @@ jobs:
5454
tag: ${{ steps.release.outputs.tag }}
5555
directory: './backend'
5656

57-
- name: Upload | Distribution Artifacts
57+
- name: Upload | Backend Distribution Artifacts
5858
uses: actions/upload-artifact@v4
5959
if: steps.release.outputs.released == 'true'
6060
with:
61-
name: distribution-artifacts
61+
name: backend-distribution-artifacts
6262
path: backend/dist
6363
if-no-files-found: error
6464

65+
- name: Build | Tutor Plugin
66+
# The tutor plugin does not use python-semantic-release directly.
67+
# Instead it shares the version determined by the backend's semantic
68+
# release above, passed in via SETUPTOOLS_SCM_PRETEND_VERSION so that
69+
# setuptools-scm picks it up at build time.
70+
if: steps.release.outputs.released == 'true'
71+
run: pip install build && SETUPTOOLS_SCM_PRETEND_VERSION=${{ steps.release.outputs.version }} python -m build
72+
working-directory: './tutor'
73+
74+
- name: Upload | Tutor Plugin Distribution Artifacts
75+
uses: actions/upload-artifact@v4
76+
if: steps.release.outputs.released == 'true'
77+
with:
78+
name: tutor-distribution-artifacts
79+
path: tutor/dist
80+
if-no-files-found: error
81+
6582
outputs:
6683
released: ${{ steps.release.outputs.released || 'false' }}
6784
version: ${{ steps.release.outputs.version }}
@@ -84,7 +101,7 @@ jobs:
84101
uses: actions/download-artifact@v4
85102
id: artifact-download
86103
with:
87-
name: distribution-artifacts
104+
name: backend-distribution-artifacts
88105
path: backend/dist
89106

90107
- name: Publish to PyPi
@@ -94,6 +111,29 @@ jobs:
94111
user: __token__
95112
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
96113

114+
publish_tutor_plugin_to_pypi:
115+
runs-on: ubuntu-latest
116+
needs: release
117+
if: github.ref_name == 'main' && needs.release.outputs.released == 'true'
118+
119+
permissions:
120+
contents: read
121+
id-token: write
122+
123+
steps:
124+
- name: Setup | Download Build Artifacts
125+
uses: actions/download-artifact@v4
126+
with:
127+
name: tutor-distribution-artifacts
128+
path: tutor/dist
129+
130+
- name: Publish to PyPi
131+
uses: pypa/gh-action-pypi-publish@release/v1
132+
with:
133+
packages-dir: tutor/dist
134+
user: __token__
135+
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
136+
97137
publish_to_npm:
98138
runs-on: ubuntu-latest
99139
needs: release

tutor/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools", "setuptools-scm>8.1"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "tutor-sample-plugin"
6+
name = "tutor-contrib-sample-plugin"
77
description = "Tutor plugin for the Open edX Sample Plugin"
88
requires-python = ">=3.11"
99
license = "Apache-2.0"

0 commit comments

Comments
 (0)