Enable releases to Marketplaces #238
Workflow file for this run
This file contains 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
# This is a basic workflow | |
name: CI | |
# Triggers the workflow on all pushes or pull requests on the main branch | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] #FIXME windows-latest fails to run tests | |
steps: | |
# Checkout code | |
- uses: actions/checkout@v4 | |
# Set up Node | |
- name: Use Node 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
# Run install dependencies | |
- name: Install dependencies | |
run: npm run install:ci | |
# Build extension | |
- name: Run build | |
run: npm run package | |
# Generate .vsix package for the extension | |
- name: Generate .vsix package | |
if: runner.os == 'Linux' | |
run: | | |
npm install -g @vscode/vsce | |
vsce package | |
# Upload VSIX artifact | |
- name: Upload VSIX artifact | |
if: runner.os == 'Linux' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vscode-granite-vsix-${{ runner.os }}-${{ github.run_id }} # Unique name with OS and run ID | |
path: "./vscode-granite-*.vsix" | |
# Run tests | |
- name: Run Test | |
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 #v1.0.1 | |
with: | |
run: npm test | |
# Update latest release (only on Linux and for main branch) | |
- name: Update latest release | |
if: runner.os == 'Linux' && github.ref == 'refs/heads/main' | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{secrets.GITHUB_TOKEN}}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
*.vsix |