-
Notifications
You must be signed in to change notification settings - Fork 56
156 lines (151 loc) · 5.87 KB
/
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
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
name: build
on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *' # monthly
jobs:
build-native:
runs-on: windows-2022
strategy:
matrix:
target: [mingw64, mingw32]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- name: Cache Downloads
id: cache-downloads
uses: actions/cache@v3
with:
path: |
downloads/*.7z
downloads/*.zip
key: ${{ runner.os }}-${{ hashFiles('ci/dependencies.ps1') }}
- run: Get-Host | Select-Object Version
- run: python -m pip install gcovr
- name: Build
run: .\ci\build.ps1 -target ${{ matrix.target }} -coverage
- name: codecov
uses: codecov/codecov-action@v3
if: "!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))"
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cobertura.xml
functionalities: search
fail_ci_if_error: true
verbose: false
- name: Upload artifact
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v3
with:
name: drmingw-${{ matrix.target }}
path: build/mingw??/drmingw-*.7z
if-no-files-found: error
build-cross-gcc:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- run: sudo dpkg --add-architecture i386
# Workaround https://github.com/actions/virtual-environments/issues/4589
- run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -qq
sudo apt-get install -yqq --allow-downgrades libgd3/jammy libpcre2-8-0/jammy libpcre2-16-0/jammy libpcre2-32-0/jammy libpcre2-posix3/jammy
sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libzip4
- run: sudo apt-get install -yqq --install-recommends mingw-w64 ninja-build cmake xinit xvfb wine wine64 wine32:i386
- run: ci/build.sh
build-cross-clang:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- name: Cache Downloads
id: cache-downloads
uses: actions/cache@v3
with:
path: downloads/*.xz
key: ${{ runner.os }}-${{ hashFiles('ci/dependencies-clang.sh') }}
- run: sudo dpkg --add-architecture i386
# Workaround https://github.com/actions/virtual-environments/issues/4589
- run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -qq
sudo apt-get install -yqq --allow-downgrades libgd3/jammy libpcre2-8-0/jammy libpcre2-16-0/jammy libpcre2-32-0/jammy libpcre2-posix3/jammy
sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libzip4
- run: sudo apt-get install -yqq --install-recommends ninja-build cmake xinit xvfb wine wine64 wine32:i386
- run: ci/build-clang.sh
- name: Upload artifact
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v3
with:
name: drmingw-clang
path: build/*-clang/drmingw-*.7z
if-no-files-found: error
# See https://github.com/actions/upload-release-asset
release:
# https://github.community/t/trigger-job-on-tag-push-only/18076/2
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: [build-native, build-cross-clang]
runs-on: windows-2022
steps:
- uses: actions/download-artifact@v3
id: download
with:
path: artifacts
- run: Get-ChildItem -Recurse "${{ steps.download.outputs.download-path }}"
- name: Asset names
id: assets
run: |
$asset32 = Get-Item "${{ steps.download.outputs.download-path }}\drmingw-mingw32\mingw32\*.7z"
$asset64 = Get-Item "${{ steps.download.outputs.download-path }}\drmingw-mingw64\mingw64\*.7z"
"mingw32-path=$($asset32.FullName)" >> $Env:GITHUB_OUTPUT
"mingw64-path=$($asset64.FullName)" >> $Env:GITHUB_OUTPUT
"mingw32-name=$($asset32.Name)" >> $Env:GITHUB_OUTPUT
"mingw64-name=$($asset64.Name)" >> $Env:GITHUB_OUTPUT
$asset64arm = Get-Item "${{ steps.download.outputs.download-path }}\drmingw-clang\aarch64-w64-mingw32-clang\*.7z"
"mingw64-arm-path=$($asset64arm.FullName)" >> $Env:GITHUB_OUTPUT
"mingw64-arm-name=$($asset64arm.Name)" >> $Env:GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Asset (32bits)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.assets.outputs.mingw32-path }}
asset_name: ${{ steps.assets.outputs.mingw32-name }}
asset_content_type: application/x-7z-compressed
- name: Upload Release Asset (64bits)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.assets.outputs.mingw64-path }}
asset_name: ${{ steps.assets.outputs.mingw64-name }}
asset_content_type: application/x-7z-compressed
- name: Upload Release Asset (64bits Arm)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.assets.outputs.mingw64-arm-path }}
asset_name: ${{ steps.assets.outputs.mingw64-arm-name }}
asset_content_type: application/x-7z-compressed