Skip to content
Merged
Show file tree
Hide file tree
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
File renamed without changes.
36 changes: 31 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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'
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openedx/sample-plugin",
"version": "0.0.1",
"version": "__semantically__released__",
"main": "src/index.jsx",
"peerDependencies": {
"@edx/frontend-platform": "*",
Expand Down