workflow and refactor #1
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" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| - '**/*.gitignore' | |
| - '**/*.gitattributes' | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| - '**/*.gitignore' | |
| - '**/*.gitattributes' | |
| workflow_dispatch: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| - '**/*.gitignore' | |
| - '**/*.gitattributes' | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' # Updated Node.js version | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install vsce | |
| run: npm install -g @vscode/vsce | |
| - name: Install cross-env | |
| run: npm install -g cross-env | |
| - name: Package | |
| run: vsce package | |
| - name: Extract Package Version | |
| id: package_version | |
| uses: Saionaro/[email protected] | |
| - name: Publish | |
| if: ${{ github.event_name == 'push' }} | |
| run: npm run deploy | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }}.vsix | |
| path: | | |
| **/*.vsix | |
| - name: 🏷️ Tag and Release | |
| id: tag_release | |
| uses: softprops/[email protected] | |
| with: | |
| tag_name: ${{ steps.package_version.outputs.version }} | |
| generate_release_notes: true | |
| files: | | |
| **/*.vsix |