OpenSilver.ControlsKit Build #62
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: OpenSilver.ControlsKit Build | |
| env: | |
| NEXT_RELEASE_VERSION: '3.4.0' | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| opensilver-version: | |
| description: 'OpenSilver version' | |
| required: true | |
| version: | |
| description: 'OpenSilver.ControlsKit package version' | |
| required: false | |
| default: '' | |
| publish-myget: | |
| description: 'Publish to MyGet.org' | |
| required: false | |
| type: boolean | |
| default: true | |
| publish-nuget-org: | |
| description: 'Publish to NuGet.org' | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| OpenSilver-ControlsKit-Build: | |
| if: github.repository_owner == 'OpenSilver' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: microsoft/setup-msbuild@v1.1.3 | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v4.x | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.x' | |
| dotnet-quality: 'ga' | |
| - name: Clone OpenSilver.ControlsKit repo | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.ref }} | |
| - name: Format Package Version | |
| id: version | |
| shell: pwsh | |
| run: | | |
| $v = "${{ github.event.inputs.version }}" | |
| if ([string]::IsNullOrWhiteSpace($v)) | |
| { | |
| $timestamp = Get-Date -Format "yyyy-MM-dd-HHmmss" | |
| $v = "$env:NEXT_RELEASE_VERSION-preview-$timestamp-$env:GITHUB_SHA_SHORT" | |
| } | |
| "value=$v" >> $env:GITHUB_OUTPUT | |
| - name: Build OpenSilver.ControlsKit NuGet package | |
| working-directory: src\build | |
| run: | | |
| ./build-nuget-package.bat ${{ steps.version.outputs.value }} ${{ github.event.inputs.opensilver-version }} | |
| - name: Upload packages to MyGet | |
| if: ${{ inputs['publish-myget'] }} | |
| run: | | |
| dotnet nuget push "src\build\output\ControlsKit\*.nupkg" -k ${{ secrets.MYGET_TOKEN }} -s https://www.myget.org/F/opensilver/api/v2/package | |
| # - name: Upload packages to NuGet.org | |
| # if: ${{ inputs['publish-nuget-org'] }} | |
| # run: | | |
| # dotnet nuget push "src\build\output\ControlsKit\*.nupkg" -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json |