forked from OpenSilver/OpenSilver
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (63 loc) · 3.24 KB
/
github-actions.yml
File metadata and controls
63 lines (63 loc) · 3.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
name: OpenSilver Build
on:
push:
branches:
- develop
jobs:
OpenSilver-Build:
#We should not run these steps on the forks by default.
if: github.repository_owner == 'OpenSilver'
runs-on: windows-2019
steps:
- 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 teamdev.licenses
run: 'echo "$TEAMDEV_LICENSE" > ./src/Simulator/Simulator/teamdev.licenses'
shell: bash
env:
TEAMDEV_LICENSE: ${{secrets.TEAMDEV_LICENSE}}
- 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.0.0/tools/;
- name: Build OpenSilver
working-directory: build
run: msbuild slnf/OpenSilver.slnf -p:Configuration=SL -clp:ErrorsOnly -restore
- name: Format Package Version
id: version
run: echo "::set-output name=suffix::$(date +'%Y-%m-%d-%H%M%S')-${{ env.GITHUB_SHA_SHORT }}"
- name: Build Simulator
working-directory: build
run: msbuild slnf/OpenSilver.Simulator.slnf -p:Configuration=SL -clp:ErrorsOnly
- name: Pack OpenSilver
working-directory: build
run: |
mkdir temp; echo "OpenSilver 1.0.0-private-${{ steps.version.outputs.suffix }}" > temp/Version.txt
nuget.exe pack nuspec\OpenSilver.nuspec -OutputDirectory "output/OpenSilver" -Properties "PackageId=OpenSilver;PackageVersion=1.0.0-private-${{ steps.version.outputs.suffix }};Configuration=SL;Target=OpenSilver;RepositoryUrl=https://github.com/${{ env.GITHUB_REPOSITORY_OWNER_PART }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}"
- name: Pack Simulator
working-directory: build
run: |
echo "OpenSilver.Simulator 1.0.0-private-${{ steps.version.outputs.suffix }}" > temp/Version.txt
nuget.exe pack nuspec\OpenSilver.Simulator.nuspec -OutputDirectory "output/OpenSilver" -BasePath ".\" -Properties "PackageVersion=1.0.0-private-${{ steps.version.outputs.suffix }};RepositoryUrl=https://github.com/${{ env.GITHUB_REPOSITORY_OWNER_PART }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}"
- uses: actions/upload-artifact@v2
with:
name: OpenSilver
path: "build/output/OpenSilver"
- name: Upload packages
run: |
dotnet nuget push "build\output\OpenSilver\*.nupkg" -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ env.GITHUB_REPOSITORY_OWNER_PART }}/index.json
- name: Upload packages to MyGet
run: |
dotnet nuget push "build\output\OpenSilver\*.nupkg" -k ${{ secrets.MYGET_TOKEN }} -s https://www.myget.org/F/opensilver/api/v2/package