Skip to content

Merge pull request #24 from lightning-js/fix/blits-file-bugs #20

Merge pull request #24 from lightning-js/fix/blits-file-bugs

Merge pull request #24 from lightning-js/fix/blits-file-bugs #20

name: Release VSCode Extension
on:
push:
branches:
- main
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install Dependencies
run: npm install
- name: Install vsce
run: npm install -g @vscode/vsce
# Read package.json and set variables
- name: Read package.json
run: |
extension_name=$(node -p "require('./package.json').name")
extension_version=$(node -p "require('./package.json').version")
echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV
echo "EXTENSION_VERSION=$extension_version" >> $GITHUB_ENV
# fixme: run tests
# - name: Run Tests
# run: npm run test
- name: Package Extension
run: npx vsce package
# Rename the vsix file
- name: Rename VSIX
run: mv *.vsix ${{ env.EXTENSION_NAME }}.v${{ env.EXTENSION_VERSION }}.vsix
# Create GitHub Pre Release and Upload VSIX
- name: Create GitHub Pre Release and Upload VSIX
run: |
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
gh release create v${{ env.EXTENSION_VERSION }} ./${{ env.EXTENSION_NAME }}.v${{ env.EXTENSION_VERSION }}.vsix --prerelease -t "blits-vscode v${{ env.EXTENSION_VERSION }}" -n "Version ${{ env.EXTENSION_VERSION }} of ${{ env.EXTENSION_NAME }}"