release #22
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 | |
| on: | |
| workflow_dispatch: | |
| env: | |
| NODE_VERSION: '18.x' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Node ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install psake | |
| shell: pwsh | |
| run: Install-Module psake -Force | |
| - name: Package vsix | |
| id: create_package | |
| shell: pwsh | |
| run: | | |
| npm install -g vsce --silent; | |
| npm install -g typescript --silent; | |
| npm install --silent; | |
| vsce package | |
| - name: Set vsix version | |
| id: vsce | |
| run: | | |
| echo "version=$(cat package.json | jq -r .version)" >> $GITHUB_OUTPUT | |
| - name: "Generate release notes" | |
| run: | | |
| export GH_HOST=github.com | |
| gh extension install chelnak/gh-changelog | |
| gh changelog get --latest > OUTPUT.md | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Github release | |
| run: | | |
| gh release create v${{ steps.vsce.outputs.version }} ./puppet-vscode-${{ steps.vsce.outputs.version }}.vsix --title v${{ steps.vsce.outputs.version }} -F OUTPUT.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish Extension | |
| id: publish-release-asset | |
| shell: pwsh | |
| run: | | |
| vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath ./puppet-vscode-${{ steps.vsce.outputs.version }}.vsix | |
| - name: Publish Extension to OpenVSX | |
| id: publish-release-asset-openvsx | |
| shell: pwsh | |
| run: | | |
| npx ovsx publish ./puppet-vscode-${{ steps.vsce.outputs.version }}.vsix -p ${{ secrets.OPENVSX_TOKEN }} |