Merge branch 'main' of https://github.com/Quanta-Naut/CodeChronicles #45
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: Minor version bump | |
env: | |
CI: true | |
run: | | |
git config --global user.name "${{ github.actor }}" # Set the username | |
git config --global user.email "123290216+Quanta-Naut@users.noreply.github.com" # Set the email | |
git add . # Add changes to the commit | |
git commit -m "Version Commit" # Commit changes | |
npm version minor # Increment the minor version in package.json | |
- name: Publish the extension | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_TOKEN }} # VSCE token for publishing | |
run: npx vsce publish # Publish the extension with the token |