Ship universal VSIX without bundled CLI binary (#2) #2
Workflow file for this run
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: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-vsix: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install extension dependencies | |
| working-directory: src/Nap.VsCode | |
| run: npm ci | |
| - name: Compile extension | |
| working-directory: src/Nap.VsCode | |
| run: npx webpack --mode production | |
| - name: Package universal VSIX | |
| working-directory: src/Nap.VsCode | |
| run: npx @vscode/vsce package --no-dependencies --skip-license | |
| - name: Upload VSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vsix | |
| path: src/Nap.VsCode/*.vsix | |
| build-cli: | |
| strategy: | |
| matrix: | |
| include: | |
| - rid: osx-arm64 | |
| asset: napper-osx-arm64 | |
| - rid: osx-x64 | |
| asset: napper-osx-x64 | |
| - rid: linux-x64 | |
| asset: napper-linux-x64 | |
| - rid: win-x64 | |
| asset: napper-win-x64.exe | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Publish CLI (${{ matrix.rid }}) | |
| run: | | |
| dotnet publish src/Nap.Cli/Nap.Cli.fsproj \ | |
| -r ${{ matrix.rid }} \ | |
| --self-contained \ | |
| -p:PublishTrimmed=true \ | |
| -p:PublishSingleFile=true \ | |
| -o out/${{ matrix.rid }} \ | |
| --nologo | |
| - name: Prepare asset | |
| run: | | |
| if [ "${{ matrix.rid }}" = "win-x64" ]; then | |
| mv out/${{ matrix.rid }}/napper.exe ${{ matrix.asset }} | |
| else | |
| mv out/${{ matrix.rid }}/napper ${{ matrix.asset }} | |
| chmod +x ${{ matrix.asset }} | |
| fi | |
| - name: Upload CLI binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli-${{ matrix.rid }} | |
| path: ${{ matrix.asset }} | |
| release: | |
| needs: [build-vsix, build-cli] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: assets | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: assets/* |