1.3.3 #6
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: Publish to WinGet | |
| on: | |
| release: | |
| types: [released] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g. 1.3.2)' | |
| required: true | |
| default: '1.3.2' | |
| jobs: | |
| publish: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Resolve tag and download URL | |
| id: release | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const tag = context.payload.inputs?.tag || context.payload.release?.tag_name; | |
| if (!tag) { core.setFailed('No tag provided'); return; } | |
| core.setOutput('version', tag); | |
| const { data } = await github.rest.repos.getReleaseByTag({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag | |
| }); | |
| const exe = data.assets.find(a => a.name === 'VirtualDesktopSwitcher.exe'); | |
| if (!exe) { core.setFailed('No exe asset found'); return; } | |
| core.setOutput('url', exe.browser_download_url); | |
| - name: Setup .NET 6 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Submit winget PR | |
| shell: pwsh | |
| run: | | |
| Invoke-WebRequest -Uri https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe | |
| .\wingetcreate.exe update Chooyy.VirtualDesktopSwitcher ` | |
| -u "$env:INSTALLER_URL|neutral" ` | |
| -v "$env:PKG_VERSION" ` | |
| -t "${{ secrets.WINGET_TOKEN }}" ` | |
| --submit | |
| env: | |
| INSTALLER_URL: ${{ steps.release.outputs.url }} | |
| PKG_VERSION: ${{ steps.release.outputs.version }} |