-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (154 loc) · 8.2 KB
/
windows.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: CI build windows
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build_windows:
name: Windows CI Build
runs-on: windows-latest
env:
Configuration: release
steps:
- name: "Install Dart"
id: install-dart
run: |
Invoke-Expression -Command "choco install dart-sdk"
Invoke-Expression -Command "dart --version"
- name: Checkout
uses: actions/checkout@v4
- name: Prepare upload artifact
id: prepare-upload-artifact
run: |
New-Item -Path "$RUNNER_TEMP" -Name "upload" -ItemType "directory"
Copy-Item "LICENSE" -Destination "$RUNNER_TEMP\upload"
Copy-Item "README.md" -Destination "$RUNNER_TEMP\upload"
New-Item -Path "$RUNNER_TEMP\upload" -Name "shared" -ItemType "directory"
Copy-Item -Path "$GITHUB_WORKSPACE\shared\*" -Destination "$RUNNER_TEMP\upload\shared"
New-Item -Path "$RUNNER_TEMP\upload" -Name "bin" -ItemType "directory"
- name: "Cache CMake"
id: cache-cmake
uses: actions/cache@v4
env:
cache-name: cache-cmake
with:
path: ${{ github.workspace }}\c\wsgup\build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Build C
run: |
Set-Location -Path "$GITHUB_WORKSPACE\c\wsgup"
Invoke-Expression -Command "cmake -B build ."
Invoke-Expression -Command "cmake --build build"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "c" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\c"
Copy-Item "build\wsgup.exe" -Destination "$RUNNER_TEMP\upload\bin\c"
- name: "Build C#"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\csharp\wsgup"
Invoke-Expression -Command "dotnet build -c Release"
Invoke-Expression -Command "dotnet build-server shutdown"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "csharp" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\csharp"
Copy-Item -Path "bin\Release\net6.0\*" -Destination "$RUNNER_TEMP\upload\bin\csharp"
- name: "Build Dart"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\dart\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "dart" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\dart"
Invoke-Expression -Command "dart pub get"
Invoke-Expression -Command "dart compile exe bin\wsgup.dart -o $RUNNER_TEMP\upload\bin\dart\wsgup.exe"
Invoke-Expression -Command "dart compile aot-snapshot bin\wsgup.dart -o $RUNNER_TEMP\upload\bin\dart\wsgup.aot"
Invoke-Expression -Command "dart compile jit-snapshot bin\wsgup.dart -o $RUNNER_TEMP\upload\bin\dart\wsgup.jit"
Invoke-Expression -Command "dart compile js bin\wsgup.dart -o $RUNNER_TEMP\upload\bin\dart\wsgup.js"
- name: "Build Go"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\go\wsgup"
Invoke-Expression -Command 'go build -ldflags "-s -w"'
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "go" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\go"
Copy-Item "wsgup.exe" -Destination "$RUNNER_TEMP\upload\bin\go"
- name: "Cache Gradle 8.9 wrapper"
id: cache-gradlew
uses: actions/cache@v4
env:
cache-name: cache-gradlew-v8.9
with:
path: C:\Users\runneradmin\.gradle
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: "Build Java"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\java\wsgup"
Invoke-Expression -Command ".\gradlew build --no-daemon --console=plain"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "java" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\java"
Copy-Item -Path "wsgup\build\libs\*" -Destination "$RUNNER_TEMP\upload\bin\java"
# tar -xvf app\build\distributions\app.tar -C $RUNNER_TEMP\upload\bin\java --strip-components=1
- name: "Build JavaScript/Node.js"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\js\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "js" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\js"
Copy-Item -Path "*" -Destination "$RUNNER_TEMP\upload\bin\js"
- name: "Build Kotlin"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\kotlin\wsgup"
Invoke-Expression -Command ".\gradlew build --no-daemon --console=plain"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "kotlin" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\kotlin"
Copy-Item -Path "wsgup\build\libs\*" -Destination "$RUNNER_TEMP\upload\bin\kotlin"
# tar -xvf wsgup\build\distributions\wsgup.tar -C $RUNNER_TEMP\upload\bin\kotlin --strip-components=1
- name: "Build Perl"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\perl\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "perl" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\perl"
Copy-Item -Path "*" -Destination "$RUNNER_TEMP\upload\bin\perl"
- name: "Build PHP"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\php\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "php" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\php"
Copy-Item -Path "*" -Destination "$RUNNER_TEMP\upload\bin\php"
- name: "Build Python"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\python\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "python" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\python"
Copy-Item -Path "*" -Destination "$RUNNER_TEMP\upload\bin\python"
- name: "Build Ruby"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\ruby\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "ruby" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\ruby"
Copy-Item -Path "*" -Destination "$RUNNER_TEMP\upload\bin\ruby"
- name: "Build Rust"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\rust\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "rust" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\rust"
Invoke-Expression -Command "cargo build --release"
Copy-Item "target\release\wsgup.exe" -Destination "$RUNNER_TEMP\upload\bin\rust"
- name: "Build Swift"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\swift\wsgup"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "swift" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\swift"
Invoke-Expression -Command "swift build -c release"
Copy-Item ".build\x86_64-unknown-windows-msvc\release\wsgup.exe" -Destination "$RUNNER_TEMP\upload\bin\swift"
- name: "Build Visual Basic.NET"
run: |
Set-Location -Path "$GITHUB_WORKSPACE\vb\wsgup"
Invoke-Expression -Command "dotnet build -c Release"
Invoke-Expression -Command "dotnet build-server shutdown"
New-Item -Path "$RUNNER_TEMP\upload\bin" -Name "vb" -ItemType "directory"
Copy-Item "..\README.md" -Destination "$RUNNER_TEMP\upload\bin\vb"
Copy-Item -Path "bin\Release\net6.0\*" -Destination "$RUNNER_TEMP\upload\bin\vb"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ runner.os }}-${{ github.sha }}
path: ${{ runner.temp }}\upload
if-no-files-found: error
retention-days: 1