-
-
Notifications
You must be signed in to change notification settings - Fork 169
57 lines (51 loc) · 2 KB
/
dev-build-pr.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
name: Dev Build PR
on: [pull_request_target, workflow_dispatch]
env:
BUILD_TYPE: Release
permissions:
contents: read
pull-requests: read
jobs:
dev-release:
runs-on: windows-latest
# Minimal permissions for this pull_request_target action
# Because we only need to read the repository contents
# By default, pull_request_target grants read/write permissions (not good)
# But it also passes along repository secrets, which we need
# unlike pull_request, which does not pass secrets
permissions:
contents: read
pull-requests: read
strategy:
matrix:
target: [uevr]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: "refs/pull/${{ github.event.number }}/merge"
token: ${{ secrets.UESDK_PULLER || github.token }}
submodules: recursive
persist-credentials: false
fetch-depth: 4
# Important security check: https://github.com/actions/checkout/issues/518
- name: Sanity check
if : ${{ github.event_name == 'pull_request_target' }}
shell: pwsh
run: |
$commits = git log -n 4 --pretty=format:%H
$previous_commit = $commits[1]
echo $commits
if ($previous_commit -ne "${{ github.event.pull_request.head.sha }}") {
throw "The pull request head commit has changed since the event was triggered."
}
- name: Configure CMake
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ${{matrix.target}}
- name: Upload artifacts
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: ${{matrix.target}}
path: ${{github.workspace}}/build/bin/${{matrix.target}}/*
if-no-files-found: error