forked from OpenSilver/OpenSilver
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (73 loc) · 4.24 KB
/
build-testapplication.yml
File metadata and controls
76 lines (73 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: TestApplication Build
env:
virtual-directory: '/testapplication/develop/opensilver/'
app-path: 'opensilverdemos/testapplication/develop/opensilver/'
virtual-directory-release: '/testapplication/release/opensilver/'
app-path-release: 'opensilverdemos/testapplication/release/opensilver/'
deploy-service-url: 'opensilverdemos.scm.azurewebsites.net:443'
next-release-version: '1.2.0'
on:
workflow_dispatch:
jobs:
TestApplicationBuild:
runs-on: windows-latest
steps:
- name: Set directory environment variables
if: "${{ github.ref == 'refs/heads/develop' }}"
run: |
echo "vdir=${{ env.virtual-directory }}" >> $env:GITHUB_ENV
echo "apath=${{ env.app-path }}" >> $env:GITHUB_ENV
- name: Set directory environment variables
if: "${{ github.ref == 'refs/heads/releases/OpenSilver/1.1.0' }}"
run: |
echo "vdir=${{ env.virtual-directory-release }}" >> $env:GITHUB_ENV
echo "apath=${{ env.app-path-release }}" >> $env:GITHUB_ENV
- uses: microsoft/setup-msbuild@v1.1
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.202'
- name: Clone OpenSilver repo
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Restore Packages
run: |
./restore-packages-opensilver.bat
nuget restore src/OpenSilver.sln -v quiet
- name: Build Compiler
run: msbuild src/Compiler/Compiler/Compiler.OpenSilver.csproj -p:Configuration=SL -clp:ErrorsOnly -restore
- name: Copy Compiler Assemblies
run: cp src/Compiler/Compiler/bin/OpenSilver/SL/net461/OpenSilver.Compiler*dll src/packages/OpenSilver.1.1.0/tools/;
- name: Build OpenSilver
working-directory: build
run: msbuild slnf/OpenSilver.slnf -p:Configuration=SL -clp:ErrorsOnly -restore
- name: Format Version Suffix
id: format-suffix
run: echo "suffix=$(date +'%Y-%m-%d-%H%M%S')-${{ env.GITHUB_SHA_SHORT }}" >> $env:GITHUB_OUTPUT
- name: Format Package Version
id: format-version
run: echo "version=${{ env.next-release-version }}-preview-${{ steps.format-suffix.outputs.suffix }}" >> $env:GITHUB_OUTPUT
- name: Pack OpenSilver
working-directory: build
run: |
mkdir temp; echo "OpenSilver ${{ steps.format-version.outputs.version }}" > temp/Version.txt
nuget.exe pack nuspec\OpenSilver.nuspec -OutputDirectory "output/OpenSilver" -Properties "PackageId=OpenSilver;PackageVersion=${{ steps.format-version.outputs.version }};Configuration=SL;Target=OpenSilver;RepositoryUrl=https://github.com/${{ env.GITHUB_REPOSITORY_OWNER_PART }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}"
- name: Replace text
working-directory: src\Tests\TestApplication
run: |
sed -i 's\<base href=\"/\" />\<base href=\"${{ env.vdir }}\" />\g' TestApplication.OpenSilver.Browser/wwwroot/index.html
- name: Replace UserName
working-directory: src\Tests\TestApplication
run: |
sed -i 's\USERNAME\${{ secrets.OPENSILVERDEMOSUSERNAME }}\g' TestApplication.OpenSilver.Browser\Properties\PublishProfiles\publish.pubxml
- name: Use OpenSilver version
working-directory: src\Tests\TestApplication
run: |
dotnet add TestApplication.OpenSilver.Browser\TestApplication.OpenSilver.Browser.csproj package OpenSilver --version ${{ steps.format-version.outputs.version }} -s ../../../build/output/OpenSilver/
dotnet add TestApplication\TestApplication.OpenSilver.csproj package OpenSilver --version ${{ steps.format-version.outputs.version }} -s ../../../build/output/OpenSilver/
- name: Build and Deploy
working-directory: src\Tests\TestApplication
run: |
msbuild TestApplication.OpenSilver.Browser\TestApplication.OpenSilver.Browser.csproj /p:DeployOnBuild=true /p:PublishProfile="TestApplication.OpenSilver.Browser\Properties\PublishProfiles\publish.pubxml" /p:Password=${{ secrets.OPENSILVERDEMOSUSERPWD }} /p:DeployIisAppPath=${{ env.apath }} /p:MSDeployServiceURL=${{ env.deploy-service-url }}