Telerik Showcase Build #25
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: Telerik Showcase Build | |
env: | |
virtual-directory: '/telerikshowcase/develop/' | |
app-path: 'opensilverdemos/telerikshowcase/develop/' | |
virtual-directory-release: '/telerikshowcase/release/' | |
app-path-release: 'opensilverdemos/telerikshowcase/release/' | |
deploy-service-url: 'opensilverdemos.scm.azurewebsites.net:443' | |
next-release-version: '1.2.0' | |
on: | |
workflow_dispatch: | |
inputs: | |
telerik-version: | |
description: 'Telerik version to use' | |
default: '2.0.0' | |
required: true | |
telerik-options: | |
type: choice | |
description: Telerik package options | |
options: | |
- develop | |
- release | |
jobs: | |
OpenSilverShowcaseBuild: | |
runs-on: windows-latest | |
steps: | |
- name: Set directory environment variables develop | |
if: "${{ github.event.inputs.telerik-options == 'develop' }}" | |
run: | | |
echo "vdir=${{ env.virtual-directory }}" >> $env:GITHUB_ENV | |
echo "apath=${{ env.app-path }}" >> $env:GITHUB_ENV | |
- name: Set directory environment variables release | |
if: "${{ github.event.inputs.telerik-options == 'release' }}" | |
run: | | |
echo "vdir=${{ env.virtual-directory-release }}" >> $env:GITHUB_ENV | |
echo "apath=${{ env.app-path-release }}" >> $env:GITHUB_ENV | |
- uses: microsoft/[email protected] | |
- name: Inject slug/short variables | |
uses: rlespinasse/[email protected] | |
- uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '7.0.200' | |
- name: Clone Telerik Showcase | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Replace Nuget.default.Config | |
run: | | |
mv Nuget.default.Config Nuget.Config | |
- name: Replace text in Nuget.Config | |
run: | | |
sed -i 's\myget_username\${{ secrets.MYGET_USERNAME }}\" />\g' Nuget.Config | |
sed -i 's\myget_password\${{ secrets.MYGET_PASSWORD }}\" />\g' Nuget.Config | |
- name: Get OpenSilver version | |
run: | | |
nuget install OpenSilver.Compatibility.TelerikUI.4.6 -source https://www.myget.org/F/opensilver-private/api/v3/index.json -source https://www.myget.org/F/opensilver-private-rc/api/v3/index.json -source https://www.myget.org/F/opensilver/api/v3/index.json -source https://api.nuget.org/v3/index.json -version ${{ github.event.inputs.telerik-version }} -output TelerikInstall | |
ls TelerikInstall | |
$opensilver_version = ls TelerikInstall -Filter OpenSilver.2* | % { $_.name } | |
$opensilver_version = $opensilver_version.Split(".", 2)[1] | |
echo $opensilver_version | |
echo "opensilver_version=$opensilver_version" >> $env:GITHUB_ENV | |
- name: Replace text | |
run: | | |
sed -zi 's\1.1.0\${{ github.event.inputs.telerik-version }}\2g' OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI.csproj | |
# sed -i 's\OpenSilver.Compatibility.TelerikUI\OpenSilver.Compatibility.TelerikUI.4.6\g' OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI.csproj | |
sed -i 's\1.1.0\${{ env.opensilver_version }}\g' OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI.csproj | |
sed -i 's\1.1.0\${{ env.opensilver_version }}\g' OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI.Browser/OpenSilver.Samples.TelerikUI.Browser.csproj | |
- name: Restore Showcase packages | |
run: | | |
nuget restore OpenSilver.Samples.TelerikUI.sln | |
- name: Replace text | |
run: | | |
sed -i 's\<base href=\"/\" />\<base href=\"${{ env.vdir }}\" />\g' OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI.Browser/wwwroot/index.html | |
- name: Replace UserName | |
run: | | |
sed -i 's\USERNAME\${{ secrets.OPENSILVERDEMOSUSERNAME }}\g' OpenSilver.Samples.TelerikUI/OpenSilver.Samples.TelerikUI.Browser/Properties/PublishProfiles/publish.pubxml | |
- name: Build and Deploy | |
run: | | |
msbuild OpenSilver.Samples.TelerikUI\OpenSilver.Samples.TelerikUI.Browser\OpenSilver.Samples.TelerikUI.Browser.csproj /p:DeployOnBuild=true /p:PublishProfile="OpenSilver.Samples.TelerikUI\OpenSilver.Samples.TelerikUI.Browser\Properties\PublishProfiles\publish.pubxml" /p:Password=${{ secrets.OPENSILVERDEMOSUSERPWD }} /p:DeployIisAppPath=${{ env.apath }} /p:MSDeployServiceURL=${{ env.deploy-service-url }} /p:Configuration=Release |