Skip to content

Update publish-extension.yml #48

Update publish-extension.yml

Update publish-extension.yml #48

name: "Publish CodeChronicles extension"
on:
push:
branches:
- main # Trigger on push to the 'main' branch
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest] # You can expand this matrix to test on other platforms if needed
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4 # Checkout the repository code
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.16.0 # Specify the exact Node.js version you need
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules # Cache the node_modules directory
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json
restore-keys: |
${{ runner.os }}-node-modules-
- name: Installing Dependencies
run: npm install # Install regular dependencies
- name: Publish the extension
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }} # VSCE token for publishing
run: npx vsce publish # Publish the extension with the token