Update publish-extension.yml #48
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
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 |