Repository navigation
ci: bump actions/upload-artifact from 4 to 7 #124
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 Release VS Code Extension | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| - 'examples/**' | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [created] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile || bun install | |
| - name: Run linting | |
| run: bun x eslint src --ext .ts --quiet | |
| - name: Run tests | |
| run: bun x jest --passWithNoTests | |
| - name: Build project | |
| run: bun run compile | |
| - name: Package extension | |
| run: bun x @vscode/vsce package --no-dependencies | |
| - name: Upload extension artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: 0xtools-extension-${{ matrix.node-version }} | |
| path: '*.vsix' | |
| retention-days: 30 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main') | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile || bun install | |
| - name: Build project | |
| run: bun run compile | |
| - name: Package extension | |
| run: bun x @vscode/vsce package --no-dependencies | |
| publish-marketplace: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile || bun install | |
| - name: Build project | |
| run: bun run compile | |
| - name: Publish to VS Code Marketplace | |
| if: env.VSCE_PAT != '' | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| run: bun x @vscode/vsce publish --no-dependencies | |
| - name: Publish to Open VSX Registry | |
| if: env.OVSX_PAT != '' | |
| env: | |
| OVSX_PAT: ${{ secrets.OVSX_PAT }} | |
| run: | | |
| bun x ovsx publish --no-dependencies |