From 225a8c5a154ce3da29865ee893c36f4afbb85640 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Fri, 23 Jan 2026 12:52:00 -0500 Subject: [PATCH 1/2] build: Drop the version from package.json We're going to be updating it as a part of the semantic release workflow but it won't make it back here so drop it from the package.json file to avoid confusion. --- frontend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 9892fbc..0bb3626 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "@openedx/sample-plugin", - "version": "0.0.1", + "version": "__semantically__released__", "main": "src/index.jsx", "peerDependencies": { "@edx/frontend-platform": "*", From 470e27eb46a6817489b0e4174c4a7dcbf5e3ffde Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 26 Jan 2026 09:58:35 -0500 Subject: [PATCH 2/2] feat: Add NPM release capabilities. Update the release workflow to also release the frontend package to NPM at the same time as the backend package gets published to PyPI. We don't run the full semantic rlease process on the frontend because we already did that with python-semantic-release so we just need to update the frontend version and release it. --- .github/workflows/{ci.yml => backend-ci.yml} | 0 .github/workflows/release.yml | 36 +++++++++++++++++--- 2 files changed, 31 insertions(+), 5 deletions(-) rename .github/workflows/{ci.yml => backend-ci.yml} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/backend-ci.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/backend-ci.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb8f4b4..227d6b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,11 +5,11 @@ on: branches: [main] jobs: - run_tests: - uses: ./.github/workflows/ci.yml + run_backend_tests: + uses: ./.github/workflows/backend-ci.yml release: - needs: run_tests + needs: run_backend_tests runs-on: ubuntu-latest if: github.ref_name == 'main' concurrency: @@ -27,7 +27,7 @@ jobs: # while the workflow was running, which prevents accidentally releasing un-evaluated # changes. - name: Setup | Checkout Repository on Release Branch - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: ${{ github.ref_name }} @@ -64,8 +64,9 @@ jobs: outputs: released: ${{ steps.release.outputs.released || 'false' }} + version: ${{ steps.release.outputs.version }} - publish: + publish_to_pypi: # 1. Separate out the publish step from the github release step to run each step at # the least amount of token privilege # 2. Also, publishing can fail, and its better to have a separate job if you need to retry @@ -92,3 +93,28 @@ jobs: packages-dir: backend/dist user: __token__ password: ${{ secrets.PYPI_UPLOAD_TOKEN }} + + publish_to_npm: + runs-on: ubuntu-latest + needs: release + if: github.ref_name == 'main' && needs.release.outputs.released == 'true' + permissions: + contents: read + id-token: write + + steps: + - name: Setup | Checkout Repository on Release Ref + uses: actions/checkout@v6 + with: + ref: ${{ github.sha }} + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version-file: './frontend/.nvmrc' + + - name: Update the package version and publish + run: | + npm version ${{ needs.release.outputs.version }} + npm publish + working-directory: './frontend'