-
Notifications
You must be signed in to change notification settings - Fork 16
46 lines (36 loc) · 1.08 KB
/
snapkey.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
name: C/C++ CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache MinGW
uses: actions/cache@v3
with:
path: C:\tools\mingw64
key: mingw-${{ runner.os }}-${{ hashFiles('**/SnapKey.cpp', '**/resources.rc') }}
restore-keys: |
mingw-${{ runner.os }}-
- name: Install MinGW
if: steps.cache.outputs.cache-hit != 'true'
run: choco install mingw
- name: Add MinGW to Path
run: echo "C:\tools\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding ascii -Append
- name: Compile resource file
run: windres resources.rc -o resources.o
- name: Compile the executable
run: g++ -o SnapKey SnapKey.cpp resources.o -mwindows -std=c++11 -static
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: SnapKey-executable
path: SnapKey.exe
- name: Run executable
run: .\SnapKey.exe
if: always()