Skip to content

setup ci

setup ci #84

name: OpenSilver Build
env:
next-release-version: '1.2.0'
current-release-version: '1.1.0'
on:
push:
branches:
- develop
jobs:
OpenSilver-Build:
#We should not run these steps on the forks by default.
if: github.repository_owner == 'barjonp'
runs-on: windows-latest
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.203'
- 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=Release -clp:ErrorsOnly -restore;
msbuild src/Compiler/Compiler.ResourcesExtractor/Compiler.ResourcesExtractor.OpenSilver.csproj -p:Configuration=Release -clp:ErrorsOnly -restore;
- name: Copy Compiler Assemblies
run: |
cp src/Compiler/Compiler/bin/OpenSilver/Release/net461/OpenSilver.Compiler*dll src/packages/OpenSilver.${{env.current-release-version}}/tools/;
cp src/Compiler/Compiler/bin/OpenSilver/Release/net461/Mono.Cecil*dll src/packages/OpenSilver.${{env.current-release-version}}/tools/;
cp src/Compiler/Compiler.ResourcesExtractor/bin/OpenSilver/Release/net461/OpenSilver.Compiler.Resources.dll src/packages/OpenSilver.${{env.current-release-version}}/tools/;
- name: Copy Targets
run: |
cp src/Targets/OpenSilver.targets src/packages/OpenSilver.${{env.current-release-version}}/build/;
cp src/Targets/OpenSilver.Common.targets src/packages/OpenSilver.${{env.current-release-version}}/build/;
cp src/Targets/OpenSilver.GenerateAssemblyInfo.targets src/packages/OpenSilver.${{env.current-release-version}}/build/;
- 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 "::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 }}-preview-cl-${{ steps.format-suffix.outputs.suffix }}"
- name: Build Simulator
working-directory: build
run: msbuild slnf/OpenSilver.Simulator.slnf -p:Configuration=SL -clp:ErrorsOnly -restore
- 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: Pack Simulator
working-directory: build
run: |
echo "OpenSilver.Simulator ${{ steps.format-version.outputs.version }}" > temp/Version.txt
nuget.exe pack nuspec\OpenSilver.Simulator.nuspec -OutputDirectory "output/OpenSilver" -BasePath ".\" -Properties "PackageVersion=${{ steps.format-version.outputs.version }};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 to MyGet
run: |
dotnet nuget push "build\output\OpenSilver\*.nupkg" -k ${{ secrets.MYGET_TEMP_TOKEN }} -s https://www.myget.org/F/opensilver-temp/api/v2/package