Release and Publish VSIX #4
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: 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: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - 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: pnpm install | |
| - name: Build VSIX package | |
| run: pnpm run package | |
| - name: Rename extension file | |
| run: "mv extension.vsix postgres-language-server-${{ steps.get_version.outputs.version }}.vsix" | |
| - 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 }} |