OpenRia Build #176
This file contains 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: OpenRia Build | |
env: | |
solution: 'OpenRiaServices.OpenSilver.sln' | |
opensilver-package-source: 'https://www.myget.org/F/opensilver/api/v3/index.json' | |
next-release-version: '1.2.0' | |
suffix: 'preview' | |
on: | |
# We run the process manually and pass the version of actual OpenSilver | |
workflow_dispatch: | |
inputs: | |
opensilver-version: | |
description: 'OpenSilver package version' | |
default: 'latest' | |
required: true | |
schedule: | |
# Every Sunday at 5AM UTC | |
- cron: "0 5 * * 0" | |
jobs: | |
OpenRia-Build: | |
runs-on: windows-latest | |
steps: | |
- uses: microsoft/[email protected] | |
- name: Inject slug/short variables | |
uses: rlespinasse/[email protected] | |
- uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.101' | |
- name: Clone repo | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Add Rc package source | |
run: | | |
nuget sources Add -Name opensilver-private-rc -Source "${{ secrets.MYGET_PRIVATE_RC_FEED_V3 }}" -username "${{ secrets.MYGET_PRIVATE_USERNAME }}" -password "${{ secrets.MYGET_PRIVATE_APIKEY }}" | |
if: env.suffix == 'rc' | |
- name: Fill vars | |
id: vars | |
run: | | |
$version = "${{ github.event.inputs.opensilver-version }}" | |
$source = "${{ env.opensilver-package-source }}" | |
$suffix = "${{ env.suffix }}" | |
if ($suffix -eq "rc") { | |
$source = "${{ secrets.MYGET_PRIVATE_RC_FEED_V3 }}" | |
} | |
if ($version -eq "latest" -or $version -eq "") { | |
$version = nuget list -Source $source -Prerelease | ? { $_ -match "^OpenSilver\s+(.*)" } | ForEach { $_.split(" ")[1] } | |
} | |
echo "Version: $version" | |
echo "::set-output name=opensilver-version::$version" | |
echo "::set-output name=suffix::$(date +'%Y-%m-%d-%H%M%S')-${{ env.GITHUB_SHA_SHORT }}" | |
- name: Build solution | |
run: | | |
msbuild ${{ env.solution }} -p:Configuration=Release -p:OpenSilverPackageVersion=${{ steps.vars.outputs.opensilver-version }} -clp:ErrorsOnly -restore | |
- name: Format Version Suffix | |
id: format-suffix | |
run: echo "::set-output name=suffix::$(date +'%Y-%m-%d-%H%M%S')-${{ env.GITHUB_SHA_SHORT }}" | |
- name: Format Package Version | |
id: format-version | |
run: echo "::set-output name=version::${{ env.next-release-version }}-${{env.suffix}}-${{ steps.format-suffix.outputs.suffix }}" | |
- name: Pack packages | |
working-directory: OpenRiaServices.NuGet | |
run: | | |
.\Pack-Client-OS.ps1 -Version ${{ steps.format-version.outputs.version }} -OpenSilverDependencyVersion ${{ steps.vars.outputs.opensilver-version }} -RepositoryUrl https://github.com/${{ env.GITHUB_REPOSITORY_OWNER_PART }}/${{ env.GITHUB_REPOSITORY_NAME_PART }} | |
- name: Upload packages | |
run: | | |
dotnet nuget push "OpenRiaServices.NuGet\bin\opensilver\*.nupkg" -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ env.GITHUB_REPOSITORY_OWNER_PART }}/index.json | |
- name: Upload packages to MyGet | |
if: github.repository_owner == 'OpenSilver' && env.suffix == 'preview' | |
run: | | |
dotnet nuget push "OpenRiaServices.NuGet\bin\opensilver\*.nupkg" -k ${{ secrets.MYGET_TOKEN }} -s https://www.myget.org/F/opensilver/api/v2/package | |
- name: Upload packages to MyGet RC | |
if: github.repository_owner == 'OpenSilver' && env.suffix == 'rc' | |
run: | | |
dotnet nuget push "OpenRiaServices.NuGet\bin\opensilver\*.nupkg" -k ${{ secrets.MYGET_PRIVATE_RC_FEED_TOKEN }} -s ${{ secrets.MYGET_PRIVATE_RC_FEED }} | |
- name: Pack OpenRia Final Release | |
working-directory: OpenRiaServices.NuGet | |
run: | | |
.\Pack-Client-OS.ps1 -Version ${{ env.next-release-version }} -OpenSilverDependencyVersion ${{ env.next-release-version }} -RepositoryUrl https://github.com/${{ env.GITHUB_REPOSITORY_OWNER_PART }}/${{ env.GITHUB_REPOSITORY_NAME_PART }} | |
if: env.suffix == 'rc' | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: OpenRia4.6 | |
path: "OpenRiaServices.NuGet/bin/OpenSilver" |