-
Notifications
You must be signed in to change notification settings - Fork 25
/
action.yml
75 lines (68 loc) · 2.66 KB
/
action.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
name: 'Handle Failure'
description: 'Handle a build failure'
inputs:
vcpkg-path:
description: 'Relative path under $GITHUB_WORKSPACE to the vcpkg repository'
required: true
nakama-cpp-path:
description: 'Relative path under $GITHUB_WORKSPACE to the nakama-cpp repository'
required: true
runs:
using: "composite"
steps:
- if: runner.os != 'Windows'
env:
nakama_cpp_path: ${{ inputs.nakama-cpp-path }}
vcpkg_path: ${{ inputs.vcpkg-path }}
run: |
nakama_cpp_build_dir=$GITHUB_WORKSPACE/$nakama_cpp_path/build
nakama_cpp_out_dir=$GITHUB_WORKSPACE/$nakama_cpp_path/out
vcpkg_buildtrees_dir=$GITHUB_WORKSPACE/$vcpkg_path/buildtrees
if [ -d "$nakama_cpp_build_dir" ]; then
pushd "$GITHUB_WORKSPACE/$nakama_cpp_path"
zip -r build $nakama_cpp_build_dir
popd
fi
if [ -d "$nakama_cpp_out_dir" ]; then
pushd "$GITHUB_WORKSPACE/$nakama_cpp_path"
zip -r out $nakama_cpp_out_dir
popd
fi
if [ -d "$vcpkg_buildtrees_dir" ]; then
pushd "$GITHUB_WORKSPACE/$vcpkg_path"
zip -r buildtrees $vcpkg_buildtrees_dir
popd
fi
shell: bash
- if: runner.os == 'Windows'
env:
nakama_cpp_path: ${{ inputs.nakama-cpp-path }}
vcpkg_path: ${{ inputs.vcpkg-path }}
run: |
$nakama_cpp_build_dir = "$env:GITHUB_WORKSPACE/${{ env.nakama_cpp_path }}/build"
$nakama_cpp_out_dir = "$env:GITHUB_WORKSPACE/${{ env.nakama_cpp_path }}/out"
$vcpkg_buildtrees_dir = "$env:GITHUB_WORKSPACE/${{ env.vcpkg_path }}/buildtrees"
if (Test-Path -Path $nakama_cpp_build_dir) {
Push-Location "$env:GITHUB_WORKSPACE/${{ env.nakama_cpp_path }}"
Compress-Archive -Path $nakama_cpp_build_dir -DestinationPath build.zip
Pop-Location
}
if (Test-Path -Path $nakama_cpp_out_dir) {
Push-Location "$env:GITHUB_WORKSPACE/${{ env.nakama_cpp_path }}"
Compress-Archive -Path $nakama_cpp_out_dir -DestinationPath out.zip
Pop-Location
}
if (Test-Path -Path $vcpkg_buildtrees_dir) {
Push-Location "$env:GITHUB_WORKSPACE/${{ env.vcpkg_path }}"
Compress-Archive -Path $vcpkg_buildtrees_dir -DestinationPath buildtrees.zip
Pop-Location
}
shell: powershell
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.build.outputs.artifact_name }}-workdir-debug
path: |
./${{ inputs.nakama-cpp-path }}/build.zip
./${{ inputs.nakama-cpp-path }}/out.zip
./${{ inputs.vcpkg-path }}/buildtrees.zip
retention-days: 1