-
Notifications
You must be signed in to change notification settings - Fork 0
feat(monitor): publish the session monitor as a GitHub release asset #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| # Packages the session monitor VS Code extension and attaches it to the release. | ||
| # | ||
| # The IDE image (EduIDE) installs this by URL from a release asset, the same way it | ||
| # installs data-bridge. Nothing else builds node/monitor, so the pull_request trigger | ||
| # exists to catch a broken package before a release depends on it. | ||
| name: Monitor VSIX | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'node/monitor/**' | ||
| - '.github/workflows/monitor-vsix.yml' | ||
|
|
||
| release: | ||
| types: | ||
| - published | ||
| - prereleased | ||
|
|
||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Version to stamp into the vsix (e.g. 1.2.0). Defaults to the manifest version." | ||
| required: false | ||
| default: "" | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| package: | ||
| name: Package | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: node/monitor | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| # The release tag is vX.Y.Z; a vsix version must be X.Y.Z. Same normalisation the | ||
| # image build does, and for the same reason - one release is one version string. | ||
| - name: Resolve version | ||
| id: version | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| RAW="${{ github.event_name == 'release' && github.event.release.tag_name || inputs.version }}" | ||
|
Comment on lines
+48
to
+53
|
||
| if [ -n "$RAW" ]; then | ||
| echo "VERSION=${RAW#v}" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "VERSION=" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Stamp version | ||
| if: steps.version.outputs.VERSION != '' | ||
| run: npm version "${{ steps.version.outputs.VERSION }}" --no-git-tag-version --allow-same-version | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install --no-audit --no-fund | ||
|
|
||
| # vsce runs `vscode:prepublish` (webpack --mode production) itself, so the bundle | ||
| # in the vsix is always built from this checkout. | ||
| - name: Package VSIX | ||
| run: npx vsce package --allow-star-activation --skip-license --out theia-cloud-monitor.vsix | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: theia-cloud-monitor-vsix | ||
| path: node/monitor/theia-cloud-monitor.vsix | ||
| if-no-files-found: error | ||
|
|
||
| release-asset: | ||
| name: Attach to release | ||
| if: github.event_name == 'release' | ||
| needs: package | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: theia-cloud-monitor-vsix | ||
| path: . | ||
|
|
||
| # Named with the version, so the URL in EduIDE's package.json.patch pins one build. | ||
| - name: Attach to release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAG: ${{ github.event.release.tag_name }} | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| VERSION="${TAG#v}" | ||
| mv theia-cloud-monitor.vsix "theia-cloud-monitor-${VERSION}.vsix" | ||
| gh release upload "$TAG" "theia-cloud-monitor-${VERSION}.vsix" --clobber \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Do not delete an existing release asset before its replacement is ready. On a rerun, 🤖 Prompt for AI Agents |
||
| --repo "${{ github.repository }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,6 @@ node_modules | |
| lib | ||
| build | ||
| dist | ||
|
|
||
| # Packaged VS Code extensions, produced by `npm run build:vsix` in monitor/ | ||
| *.vsix | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Remove the redundant
prereleasedtrigger.GitHub’s
publishedevent already covers pre-releases. If GitHub emits both subscribed activities for one pre-release, this workflow can build twice and start competing uploads to the same asset name. Keeppublishedas the sole release activity. (docs.github.com)🤖 Prompt for AI Agents