Skip to content

添加安装 SL 环境 #5

添加安装 SL 环境

添加安装 SL 环境 #5

name: build and deploy
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
env:
Solution_Name: ModernSL/ModernSL.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
with:
msbuild-architecture: x64
# Install the Silverlight workload
- name: Download Silverlight
run: curl $env:SourceURL -o "silverlight_sdk.exe"
env:
SourceURL: https://web.archive.org/web/20190126163602if_/http://download.microsoft.com/download/3/A/3/3A35179D-5C87-4D0A-91EB-BF5FEDC601A4/sdk/silverlight_sdk.exe
- name: Install Silverlight
run: .\silverlight_sdk.exe /q
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: Release
# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration
env:
Configuration: Release
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ModernSL/Bin/Release
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4