Bump nuget/setup-nuget from 1 to 2 #134
Workflow file for this run
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: Continuous Integration | |
on: [push, pull_request,workflow_dispatch] | |
jobs: | |
build: | |
runs-on: windows-2019 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
#[Release, Debug] | |
build_configuration: [Release] | |
build_platform: [x64, x86] | |
steps: | |
- name: Install .NET Framework for developers | |
run: choco install netfx-4.6.2-devpack | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v1 | |
- name: Setup NuGet | |
uses: nuget/setup-nuget@v2 | |
- name: Nuget restore | |
working-directory: PlantUmlViewer/ | |
run: nuget restore PlantUmlViewer.sln | |
- name: MSBuild | |
run: | | |
msbuild PlantUmlViewer/PlantUmlViewer.sln /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /m /verbosity:minimal | |
mkdir deploy | |
Copy-Item -Path "PlantUmlViewer/PlantUmlViewer/bin/${{ matrix.build_configuration }}-${{ matrix.build_platform }}/PlantUmlViewer.dll" -Destination "deploy" | |
- name: Download libraries | |
if: matrix.build_configuration == 'Release' | |
run: | | |
curl -L --url https://github.com/plantuml/plantuml/releases/download/v1.2023.10/plantuml-1.2023.10.jar --output deploy/plantuml-1.2023.10.jar | |
if ((Get-FileHash -Algorithm MD5 -Path "deploy/plantuml-1.2023.10.jar").Hash -ne "b98ae548b0e26d0ca985c4fa6cdf5665") { throw "MD5 sum is invalid" } | |
curl -L --url http://beta.plantuml.net/plantuml-jlatexmath.zip --output deploy/plantuml-jlatexmath.zip | |
if ((Get-FileHash -Algorithm MD5 -Path "deploy/plantuml-jlatexmath.zip").Hash -ne "32a81facc3b8ed331f0d19f2c23d709a") { throw "MD5 sum is invalid" } | |
tar -xf deploy/plantuml-jlatexmath.zip -C deploy | |
Remove-Item deploy/plantuml-jlatexmath.zip | |
- name: Set artifact name | |
# Replace every invalid file name character | |
run: | | |
$artifact_name="PlantUmlViewer_${{ github.ref_name }}.${{ github.sha }}_${{ matrix.build_platform }}" | |
$illegal_chars = [string]::join('',([System.IO.Path]::GetInvalidFileNameChars())) -replace '\\','\\' | |
$artifact_name=($artifact_name -replace "[$illegal_chars]", '-') | |
echo "ARTIFACT_NAME=$artifact_name" >> $env:GITHUB_ENV | |
- name: Create artifact | |
if: matrix.build_configuration == 'Release' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: deploy/ |