-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Actions workflow for building VSCode extensions #11
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
652e814
Add GitHub Actions workflow for building VSCode extensions
safoinme beb29d5
Update .github/workflows/build-extensions.yml
safoinme fae2e30
Update Node.js version in GitHub Actions workflow to 22
safoinme f6cf50f
Merge branch 'misc/add-ci-to-auto-build-extensions' of https://github…
safoinme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Build VSCode Extensions | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
pull_request: | ||
branches: [main, develop] | ||
workflow_dispatch: | ||
inputs: | ||
force_rebuild: | ||
description: 'Force rebuild even if no changes detected' | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
jobs: | ||
build-extensions: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Install vsce globally | ||
run: npm install -g @vscode/vsce | ||
|
||
- name: Build tutorial extension | ||
run: | | ||
echo "Building tutorial extension..." | ||
npm run buildExtension | ||
|
||
- name: Build theme extension | ||
run: | | ||
echo "Building theme extension..." | ||
cd themes && npx @vscode/vsce package --out ../zenml-color-theme.vsix | ||
|
||
- name: Verify extensions were built | ||
run: | | ||
echo "Checking built extensions..." | ||
if [ -d ".devcontainer/extensions" ]; then | ||
echo "Tutorial extension files:" | ||
ls -la .devcontainer/extensions/ | ||
else | ||
echo "ERROR: .devcontainer/extensions directory not found" | ||
exit 1 | ||
fi | ||
|
||
if [ -f "zenml-color-theme.vsix" ]; then | ||
echo "Theme extension built successfully:" | ||
ls -la zenml-color-theme.vsix | ||
else | ||
echo "ERROR: zenml-color-theme.vsix not found" | ||
exit 1 | ||
fi | ||
|
||
- name: Upload tutorial extension artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tutorial-extension | ||
path: .devcontainer/extensions/zenml-codespace-tutorial-*.vsix | ||
|
||
- name: Upload theme extension artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: theme-extension | ||
path: zenml-color-theme.vsix | ||
|
||
- name: Commit and push built extensions | ||
# Only commit on push to main/develop branches, not on PRs | ||
if: github.event_name == 'push' || github.event.inputs.force_rebuild == 'true' | ||
safoinme marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
|
||
# Add the built extensions to git | ||
git add .devcontainer/extensions/zenml-codespace-tutorial-*.vsix | ||
git add zenml-color-theme.vsix | ||
|
||
# Check if there are any changes to commit | ||
if git diff --staged --quiet; then | ||
echo "No changes to commit" | ||
else | ||
git commit -m "Auto-build extensions [skip ci]" | ||
git push | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.