Merge pull request #72 from koiverse/dependabot/npm_and_yarn/types/no… #182
This file contains hidden or 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: Build and Package Extension | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build-and-package: | |
| runs-on: windows-latest | |
| steps: | |
| # Checkout repository | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| # Set up Node.js environment | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| # Cache node_modules | |
| - name: Cache node_modules | |
| uses: actions/cache@v3 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node_modules- | |
| # Install dependencies | |
| - name: Install Dependencies | |
| run: yarn install | |
| # Build the extension | |
| - name: Build Extension | |
| run: yarn run build | |
| # Package the extension as a .vsix file | |
| - name: Package Extension | |
| run: yarn run package:vsix | |
| # Verify the .vsix file exists | |
| - name: Verify .vsix File | |
| run: | | |
| if (!(Test-Path *.vsix)) { | |
| Write-Error "Error: No .vsix file was found!" | |
| exit 1 | |
| } | |
| # Upload the .vsix file as an artifact | |
| - name: Upload VSIX Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ProCommit.vsix | |
| path: '*.vsix' |