-
Notifications
You must be signed in to change notification settings - Fork 9
63 lines (52 loc) · 2.46 KB
/
CI_build.yml
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: 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/