Skip to content

Commit 0d9162a

Browse files
authored
Create build.yml
1 parent 3bffb87 commit 0d9162a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# .github/workflows/xmake.yml
2+
name: xmake-build
3+
4+
on:
5+
push:
6+
branches: ["**"]
7+
pull_request:
8+
branches: ["**"]
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
build_type: [release, debug]
18+
defaults:
19+
run:
20+
shell: pwsh
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup xmake with caches
27+
uses: xmake-io/github-action-setup-xmake@v1
28+
with:
29+
xmake-version: latest
30+
# Cache xmake install itself
31+
actions-cache-folder: .xmake-cache
32+
actions-cache-key: ${{ runner.os }}-xmake-core
33+
# Cache xmake packages (requires project-path for hash)
34+
package-cache: true
35+
package-cache-key: ${{ runner.os }}-xmake-pkgs-${{ hashFiles('xmake.lua', '**/*.lua', 'xmake-requires.txt', 'xmake-lock.json') }}
36+
project-path: .
37+
# Cache build (ccache-like)
38+
build-cache: true
39+
build-cache-key: ${{ runner.os }}-xmake-bld-${{ matrix.build_type }}
40+
# (optional) build-cache-path if you want to pin it:
41+
# build-cache-path: build/.build_cache
42+
43+
- name: Configure (x64)
44+
run: |
45+
xmake f -m ${{ matrix.build_type }} -a x64 --yes --policies=build.ccache:y
46+
xmake --version
47+
xmake show -p
48+
49+
- name: Build
50+
run: xmake -vD
51+
52+
- name: Upload artifacts
53+
uses: actions/upload-artifact@v4.6.2
54+
with:
55+
name: DllInject-${{ matrix.build_type }}-x64
56+
path: |
57+
build/**
58+
if-no-files-found: error

0 commit comments

Comments
 (0)