Skip to content

Release and Publish VSIX #3

Release and Publish VSIX

Release and Publish VSIX #3

name: Release and Publish VSIX
on:
workflow_dispatch:
jobs:
create-draft-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: Get version from package.json
id: get_version
run: |
VERSION=$(jq -r .version package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Install dependencies
run: npm ci
- name: Build VSIX package
run: npm run package
- name: Find VSIX file
id: find_vsix
run: |
VERSION="${{ steps.get_version.outputs.version }}"
VSIX_FILE="postgres-language-server-$VERSION.vsix"
if [ !-f "$VSIX_FILE" ]; then
echo "VSIX file $VSIX_FILE not found!"
exit 1
fi
echo "vsix_file=$VSIX_FILE" >> $GITHUB_OUTPUT
- name: Create GitHub Release (draft)
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ steps.get_version.outputs.version }}"
name: "v${{ steps.get_version.outputs.version }}"
draft: true
body: "Postgres Language Server Extension version v${{ steps.get_version.outputs.version }} has been released! 🚀"
files: "${{ steps.find_vsix.outputs.vsix_file }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}