1.11.0 #9
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
name: CI/CD | |
on: | |
push: | |
branches: [main] | |
tags: | |
- 'v*.*.*' | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Prettier | |
run: npm run prettier:check | |
- name: Run Lint | |
run: npm run lint:check | |
- name: Run Tests | |
uses: coactions/setup-xvfb@v1 | |
with: | |
run: npm test | |
publish: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Package Extension | |
run: npm run package | |
- name: Set Environment Variables | |
run: | | |
node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version)" >> $GITHUB_ENV | |
echo "PACKAGE_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV | |
- name: Generate Changelog | |
id: changelog | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
validation_level: warn | |
version: ${{ env.PACKAGE_VERSION }} | |
path: ./CHANGELOG.md | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: ${{ github.ref_name }} | |
body: ${{ steps.changelog.outputs.changes }} | |
draft: false | |
prerelease: false | |
files: ${{ env.PACKAGE_PATH }} | |
- name: Publish Extension | |
run: npm run publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} |