Skip to content

Add git-tag dependency to publish targets in Makefile #40

Add git-tag dependency to publish targets in Makefile

Add git-tag dependency to publish targets in Makefile #40

Workflow file for this run

name: Publish Extension
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Configure Git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
- name: Increment version
if: startsWith(github.ref, 'refs/tags/v')
run: |
npm version patch --no-git-tag-version
VERSION=$(node -p "require('./package.json').version")
echo "NEW_VERSION=v$VERSION" >> $GITHUB_ENV
- name: Commit version update
if: startsWith(github.ref, 'refs/tags/v')
run: |
git add package.json
git commit -m "Bump version to ${{ env.NEW_VERSION }}"
git push
- name: Install dependencies
run: |
yarn install --frozen-lockfile
yarn global add @vscode/vsce@2.22.0 ovsx
- name: Build
run: yarn run vscode:prepublish
- name: Package Extension
run: vsce package
- name: Upload VSIX as Artifact
uses: actions/upload-artifact@v4
with:
name: extension
path: "*.vsix"
retention-days: 90
- name: Publish to VS Code Marketplace
if: startsWith(github.ref, 'refs/tags/v')
run: vsce publish -p ${{ secrets.VSCE_PAT }}
- name: Publish to Open VSX Registry
if: startsWith(github.ref, 'refs/tags/v')
run: ovsx publish *.vsix -p ${{ secrets.OVSX_PAT }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: "*.vsix"
draft: false
prerelease: false
generate_release_notes: true