-
-
Notifications
You must be signed in to change notification settings - Fork 24
108 lines (91 loc) · 3.65 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
name: Build, test and publish
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
jobs:
build_test_and_publish:
name: Build, test and publish local
if: github.repository_owner == 'ParadoxGameConverters'
runs-on: [self-hosted, windows]
steps:
- name: "Cloning repo"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Cloning selective submodules"
run: |
git submodule update --init --recursive commonItems
git -c submodule."external/commonItems".update=none `
submodule update --init --recursive Fronter
- name: "Get previous tag"
if: ${{ github.event_name == 'push' }}
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: "Build solution"
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\"
.\MSBuild.exe -m -p:Configuration=Release $Env:GITHUB_WORKSPACE\EU4ToVic3.sln
- name: "Run tests"
run: |
cd $Env:GITHUB_WORKSPACE\Release-Tests\
.\EU4ToVic3Tests.exe
- name: "Prepare release"
# if: ${{ github.event_name == 'push' }}
run: |
cd "C:\Program Files\7-Zip\"
.\7z.exe a $Env:GITHUB_WORKSPACE\EU4ToVic3-0.2.2Belgrade-win-x64.zip $Env:GITHUB_WORKSPACE\Release\*
cp $Env:GITHUB_WORKSPACE\EU4ToVic3-0.2.2Belgrade-win-x64.zip $Env:GITHUB_WORKSPACE\EU4ToVic3-latest-win-x64.zip
- name: "Prepare installer"
# if: ${{ github.event_name == 'push' }}
run: |
c:\"Program Files (x86)\Inno Setup 6\iscc" EU4ToVic3-Installer.iss
cp $Env:GITHUB_WORKSPACE\Output\EU4ToVic3-latest-win-x64.exe $Env:GITHUB_WORKSPACE\Output\EU4ToVic3-0.2.2Belgrade-win-x64.exe
- name: "Upload binaries to release"
if: ${{ github.event_name == 'push' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.previoustag.outputs.tag }}
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: EU4ToVic3-0.2.2Belgrade-win-x64.zip, Output\EU4ToVic3-0.2.2Belgrade-win-x64.exe
token: ${{ secrets.API_TOKEN_GITHUB }}
- name: "Upload binaries to archive"
if: ${{ github.event_name == 'push' }}
uses: ncipollo/release-action@v1
with:
tag: windows_development_build
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: EU4ToVic3-0.2.2Belgrade-win-x64.zip, EU4ToVic3-latest-win-x64.zip, Output\EU4ToVic3-0.2.2Belgrade-win-x64.exe, Output\EU4ToVic3-latest-win-x64.exe
token: ${{ secrets.API_TOKEN_GITHUB }}
- name: "Cleanup"
if: always()
run: |
Get-ChildItem -Path $Env:GITHUB_WORKSPACE -Recurse -Force | Remove-Item -force -recurse
build_test:
name: Build and test foreign
if: github.repository_owner != 'ParadoxGameConverters'
runs-on: windows-2022
steps:
- name: "Cloning repo"
uses: actions/checkout@v3
- name: "Cloning selective submodules"
run: |
git submodule update --init --recursive commonItems
git -c submodule."external/commonItems".update=none `
submodule update --init --recursive Fronter
- name: "Build solution"
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe -m -p:Configuration=Release $Env:GITHUB_WORKSPACE\EU4ToVic3.sln
- name: "Run tests"
run: |
cd $Env:GITHUB_WORKSPACE\Release-Tests\
.\EU4ToVic3Tests.exe