-
Notifications
You must be signed in to change notification settings - Fork 6
143 lines (121 loc) · 4.94 KB
/
windows_msys2.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
##########################################
# BletchMAME Windows MSYS2 Github Action #
##########################################
name: Windows MSYS2
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
# Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
# Install MSYS2
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
release: false
install: git parallel p7zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-polly mingw-w64-x86_64-mlir mingw-w64-x86_64-clang mingw-w64-x86_64-clang-analyzer mingw-w64-x86_64-clang-tools-extra mingw-w64-x86_64-qt6-static mingw-w64-x86_64-jasper mingw-w64-x86_64-graphite2 patch
# Cache Dependencies
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-deps
with:
path: deps/install
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.build_type }}-${{ hashFiles('.github/workflows/windows_msys2.yml', 'scripts/quazip_build_msys2.sh', 'scripts/lzma_build_msys2.sh')}}
# Retrieve QuaZip
- name: Retrieve QuaZip
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
git submodule update --init deps/quazip
# Retrieve lzma-c-sdk
- name: Retrieve lzma-c-sdk
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
git submodule update --init deps/lzma-c-sdk
# Build QuaZip
- name: Build QuaZip
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
sh scripts/quazip_build_msys2.sh
# Build lzma-c-sdk
- name: Build lzma-c-sdk
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
sh scripts/lzma_build_msys2.sh -b ${{ matrix.build_type }}
# Build BletchMAME
- name: Build BletchMAME
run: |
sh scripts/bletchmame_build_msys2.sh -b ${{ matrix.build_type }}
# Validate DLL Imports
- name: Validate DLL Imports
run: perl scripts/validate_dllimports.pl
# Run Unit Tests
- name: Run Unit Tests
shell: bash
run: |
./build/msys2/BletchMAME_tests.exe
# Run integration testing with actual MAME
- name: Run integration testing with actual MAME
run: |
sh scripts/run_mame_integration_testing.sh
# Install PanDoc
- name: Install PanDoc
shell: bash
run: |
mkdir -p deps
curl -L -f "https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-windows-x86_64.zip" > deps/pandoc-2.10.1-windows-x86_64.zip
7z x deps/pandoc-2.10.1-windows-x86_64.zip -odeps
# Generate readme.html
- name: Generate readme.html
run: deps/pandoc-2.10.1/pandoc.exe README.md -o readme.html
# Build MSI - Candle
- name: Build MSI - Candle
run: /c/program\ files\ \(x86\)/WiX\ Toolset\ v3.11/bin/candle -v bletchmame.wxs -dVERSION=`git describe --tags | perl scripts/process_version.pl` -out bletchmame.wixobj
# Build MSI - Light
- name: Build MSI - Light
run: /c/program\ files\ \(x86\)/WiX\ Toolset\ v3.11/bin/light -v -ext WixUIExtension -ext WixUtilExtension bletchmame.wixobj -out BletchMAME.msi
# Prepare Artifacts
- name: Prepare Artifacts
shell: bash
run: |
mkdir rel
git describe --tags | perl scripts/process_version.pl > rel/version_latest.txt
mv BletchMAME.msi rel/BletchMAME_latest.msi
7z a rel/BletchMAME_latest.zip ./build/msys2/bin/BletchMAME.exe
7z a rel/BletchMAME_latest.zip readme.html
7z a rel/BletchMAME_latest.zip plugins
# Configure AWS Credentials
- name: Configure AWS Credentials
if: success() && github.ref == 'refs/heads/master' && matrix.build_type == 'Release'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# Deploy Artifacts to S3
- name: Deploy Artifacts to S3
if: success() && github.ref == 'refs/heads/master' && matrix.build_type == 'Release'
shell: bash
run: aws s3 sync ./rel/ s3://bletchmame-web-dyn/dyn/ --delete