Publish extension #17
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: | |
| workflow_dispatch | |
| jobs: | |
| package: | |
| name: Package | |
| strategy: | |
| matrix: | |
| include: | |
| - target: win32-x64 | |
| - target: linux-x64 | |
| - target: darwin-x64 | |
| - target: darwin-arm64 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.setup-tag.outputs.tag }} | |
| version: ${{ steps.setup-tag.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| npm install | |
| cd src/wrapp_editor && npm install && cd ../.. | |
| - name: Package | |
| run: | | |
| npx @vscode/vsce package --out webrogue-vscode-${{ matrix.target }}.vsix --target ${{ matrix.target }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: webrogue-vscode-${{ matrix.target }}.vsix | |
| if-no-files-found: error | |
| retention-days: 1 | |
| path: ./webrogue-vscode-*.vsix | |
| - name: Setup tag | |
| id: setup-tag | |
| run: | | |
| $version = (Get-Content ./package.json -Raw | ConvertFrom-Json).version | |
| Write-Host "tag: release/$version" | |
| Write-Host "::set-output name=tag::release/$version" | |
| Write-Host "::set-output name=version::$version" | |
| shell: pwsh | |
| publishMS: | |
| name: Publish to VS marketplace | |
| runs-on: ubuntu-latest | |
| needs: package | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: webrogue-vscode-*.vsix | |
| merge-multiple: true | |
| - name: Publish to VS marketplace | |
| run: npx @vscode/vsce publish --packagePath ./webrogue-vscode-*.vsix -p ${{ secrets.VSCE_PAT }} | |
| publishOVSX: | |
| name: Publish to Open VSX | |
| runs-on: ubuntu-latest | |
| needs: package | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: webrogue-vscode-*.vsix | |
| merge-multiple: true | |
| - name: Publish to Open VSX | |
| run: ls webrogue-vscode-*.vsix | xargs -I{} npx ovsx publish {} -p ${{ secrets.OVSX_PAT }} | |
| publishGH: | |
| name: Publish to GitHub releases | |
| runs-on: ubuntu-latest | |
| needs: package | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: webrogue-vscode-*.vsix | |
| merge-multiple: true | |
| - uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: | | |
| webrogue-vscode-*.vsix | |
| name: Release ${{ needs.package.outputs.version }} | |
| allowUpdates: false | |
| tag: ${{ needs.package.outputs.tag }} | |
| commit: ${{ github.ref }} | |
| makeLatest: true |