1.2.1 #18
Workflow file for this run
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: Publish Extension | |
| on: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Install vsce | |
| run: pnpm add -g @vscode/vsce | |
| - name: Extract version from tag | |
| if: github.event_name == 'release' | |
| run: | | |
| version=${GITHUB_REF#refs/tags/} | |
| version=${version#v} | |
| echo "RELEASE_VERSION=$version" >> $GITHUB_ENV | |
| echo "Version extracted: $version" | |
| - name: Update package.json version | |
| if: github.event_name == 'release' | |
| run: | | |
| echo "Updating package.json version to $RELEASE_VERSION" | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$CURRENT_VERSION" != "$RELEASE_VERSION" ]; then | |
| npm version $RELEASE_VERSION --no-git-tag-version | |
| echo "Updated version to: $(node -p 'require(\'./package.json\').version')" | |
| else | |
| echo "Version already at $RELEASE_VERSION, skipping npm version" | |
| fi | |
| - name: Package extension | |
| run: pnpm run package | |
| - name: Debug included files | |
| run: | | |
| echo "Files that will be included in the extension:" | |
| timeout 60s vsce ls | |
| echo "Total files count:" | |
| vsce ls | wc -l | |
| - name: Publish extension | |
| if: success() && github.event_name == 'release' | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| run: vsce publish -p $VSCE_PAT |