Skip to content

Package and Release VS Code Extension #60

Package and Release VS Code Extension

Package and Release VS Code Extension #60

Workflow file for this run

name: Package and Release VS Code Extension
on:
release:
types: [published]
# TODO: transition to platform specific build jobs https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
suffix: linux
- os: macOS-latest
suffix: darwin
- os: windows-latest
suffix: win32
fail-fast: false
name: ${{ matrix.os }}
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Go to install-locator
run: cd install-locator
- name: Install Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build Locator
run: ./install-locator/gradlew runtime -p install-locator
- name: Upload result
uses: actions/upload-artifact@v4
with:
name: install-locator-${{ matrix.suffix }}
path: install-locator/build/image
retention-days: 1
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: install-locator-*
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Commit Changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "Processing Bot"
git add .
git commit -m "Prepare release ${{ github.event.release.tag_name }}"
- name: Package extension
run: vsce package ${{ github.event.release.tag_name }}
- name: Upload VSIX to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.vsix'
tag: ${{ github.ref }}
file_glob: true
- name: Publish Extension
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
vsce publish ${{ github.event.release.tag_name }}