-
Notifications
You must be signed in to change notification settings - Fork 7
150 lines (124 loc) · 4.74 KB
/
windows_build_test_and_push.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
name: Build, test and publish
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_local:
name: Build and publish local
if: github.repository_owner == 'ParadoxGameConverters'
runs-on: [ self-hosted, windows, noramdisk ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: "Get previous tag"
if: ${{ github.event_name == 'push' }}
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: "Build converter sln"
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\"
.\MSBuild.exe -m -p:Configuration=Release $Env:GITHUB_WORKSPACE\ImperatorToCK2.sln -target:ImperatorToCK2
- name: "Build converter jar"
run: |
cd $Env:GITHUB_WORKSPACE\ImperatorToCk2
mvn package
- name: "Copy jar to Release directory"
run: |
cp ImperatorToCK2/target/ImperatorToCK2.jar Release/ImperatorToCK2
- name: "Build converter executable"
run: |
cd $Env:GITHUB_WORKSPACE\ImperatorToCk2
mvn -e -X clean verify
- name: "Copy backend to Release directory"
run: |
xcopy /y /r /s ImperatorToCk2\target\jpackage\ImperatorToCK2 Release\ImperatorToCK2\
- name: "Replace frontend background image"
run: |
rm Fronter.NET/Fronter.NET/Assets/Images/background.png
cp Resources/images/SteamMainImage.png Fronter.NET/Fronter.NET/Assets/Images/background.png
- name: "Build frontend"
uses: ./Fronter.NET/.github/actions/build_frontend
with:
fronter_dir: 'Fronter.NET'
release_dir: 'Release'
- name: "Prepare release zip"
if: ${{ github.event_name == 'push' }}
run: |
cd "C:\Program Files\7-Zip\"
.\7z.exe a $Env:GITHUB_WORKSPACE\ImperatorToCK2-win-x64.zip $Env:GITHUB_WORKSPACE\Release\*
cp $Env:GITHUB_WORKSPACE\ImperatorToCK2-win-x64.zip $Env:GITHUB_WORKSPACE\ImperatorToCK2-latest.zip
- uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'push' }}
with:
path: Release/
- name: "Upload binary to current release"
if: ${{ github.event_name == 'push' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.previoustag.outputs.tag }}
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: ImperatorToCK2-win-x64.zip
token: ${{ secrets.API_TOKEN_GITHUB }}
- name: "Upload binary to latest release"
if: ${{ github.event_name == 'push' }}
uses: ncipollo/release-action@v1
with:
tag: latest
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: ImperatorToCK2-latest.zip
token: ${{ secrets.API_TOKEN_GITHUB }}
- name: "Cleanup"
if: always()
run: |
Get-ChildItem -Path $Env:GITHUB_WORKSPACE -Recurse -Force | Remove-Item -force -recurse
build_foreign:
name: Build foreign
if: github.repository_owner != 'ParadoxGameConverters'
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: "Build converter sln"
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe -m -p:Configuration=Release $Env:GITHUB_WORKSPACE\ImperatorToCK2.sln -target:ImperatorToCK2
- name: "Build converter jar"
run: |
cd $Env:GITHUB_WORKSPACE\ImperatorToCk2
mvn package
- name: "Copy jar to Release directory"
run: |
cp ImperatorToCK2/target/ImperatorToCK2.jar Release/ImperatorToCK2
- name: "Build converter executable"
run: |
cd $Env:GITHUB_WORKSPACE\ImperatorToCk2
mvn -e -X clean verify
- name: "Copy backend to Release directory"
run: |
xcopy /y /r /s ImperatorToCk2\target\jpackage\ImperatorToCK2 Release\ImperatorToCK2\
- name: "Replace frontend background image"
run: |
rm Fronter.NET/Fronter.NET/Assets/Images/background.png
cp Resources/images/SteamMainImage.png Fronter.NET/Fronter.NET/Assets/Images/background.png
- name: "Build frontend"
uses: ./Fronter.NET/.github/actions/build_frontend
with:
fronter_dir: 'Fronter.NET'
release_dir: 'Release'
- uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'push' }}
with:
path: Release/