17
17
build-linux :
18
18
runs-on : ubuntu-latest
19
19
20
- permissions :
21
- contents : write
22
-
23
20
steps :
24
21
- name : Check out repository
25
- uses : actions/checkout@v4
22
+ uses : actions/checkout@v4.2.2
26
23
with :
27
24
ref : ${{ github.event.pull_request.head.ref }}
28
25
@@ -31,35 +28,22 @@ jobs:
31
28
mkdir -p build
32
29
g++ -std=c++17 -shared -fPIC -o build/libRhythmGameUtilities.so include/RhythmGameUtilities/RhythmGameUtilities.cpp
33
30
34
- - name : Copy Release
35
- run : |
36
- mkdir -p UnityPackage/Libs/Linux
37
- mkdir -p RhythmGameUtilities/Libs/Linux
38
- cp build/libRhythmGameUtilities.so UnityPackage/Libs/Linux
39
- cp build/libRhythmGameUtilities.so RhythmGameUtilities/Libs/Linux
40
-
41
- - name : Setup git
42
- run : |
43
- git config user.name 'github-actions[bot]'
44
- git config user.email 'github-actions[bot]@users.noreply.github.com'
31
+ - name : Upload build artifacts
32
+
33
+ with :
34
+ name : build-linux-files
35
+ path : build/
36
+ retention-days : 1
45
37
46
- - name : Git commit changes
47
- run : |
48
- git pull
49
- git add UnityPackage/Libs/Linux/libRhythmGameUtilities.so
50
- git add RhythmGameUtilities/Libs/Linux/libRhythmGameUtilities.so
51
- git commit -m "Updated libRhythmGameUtilities.so [skip ci]" || exit 0
52
- git push
53
38
build-macos :
54
39
runs-on : macos-latest
55
- needs : build-linux
56
40
57
41
permissions :
58
42
contents : write
59
43
60
44
steps :
61
45
- name : Check out repository
62
- uses : actions/checkout@v4
46
+ uses : actions/checkout@v4.2.2
63
47
with :
64
48
ref : ${{ github.event.pull_request.head.ref }}
65
49
@@ -71,35 +55,22 @@ jobs:
71
55
lipo -create -output build/libRhythmGameUtilities.dylib build/libRhythmGameUtilities-arm64.dylib build/libRhythmGameUtilities-x86_64.dylib
72
56
lipo -info build/libRhythmGameUtilities.dylib
73
57
74
- - name : Copy Release
75
- run : |
76
- mkdir -p UnityPackage/Libs/macOS
77
- mkdir -p RhythmGameUtilities/Libs/macOS
78
- cp build/libRhythmGameUtilities.dylib UnityPackage/Libs/macOS
79
- cp build/libRhythmGameUtilities.dylib RhythmGameUtilities/Libs/macOS
80
-
81
- - name : Setup git
82
- run : |
83
- git config user.name 'github-actions[bot]'
84
- git config user.email 'github-actions[bot]@users.noreply.github.com'
58
+ - name : Upload build artifacts
59
+
60
+ with :
61
+ name : build-macos-files
62
+ path : build/
63
+ retention-days : 1
85
64
86
- - name : Git commit changes
87
- run : |
88
- git pull
89
- git add UnityPackage/Libs/macOS/libRhythmGameUtilities.dylib
90
- git add RhythmGameUtilities/Libs/macOS/libRhythmGameUtilities.dylib
91
- git commit -m "Updated libRhythmGameUtilities.dylib [skip ci]" || exit 0
92
- git push
93
65
build-windows :
94
66
runs-on : windows-latest
95
- needs : build-macos
96
67
97
68
permissions :
98
69
contents : write
99
70
100
71
steps :
101
72
- name : Check out repository
102
- uses : actions/checkout@v4
73
+ uses : actions/checkout@v4.2.2
103
74
with :
104
75
ref : ${{ github.event.pull_request.head.ref }}
105
76
@@ -112,25 +83,55 @@ jobs:
112
83
link /DLL /MACHINE:X64 /OUT:build\libRhythmGameUtilities.dll /IMPLIB:build\libRhythmGameUtilities.lib build\RhythmGameUtilities.obj
113
84
del build\RhythmGameUtilities.obj
114
85
115
- - name : Copy Release
116
- shell : cmd
86
+ - name : Upload build artifacts
87
+
88
+ with :
89
+ name : build-windows-files
90
+ path : build/
91
+ retention-days : 1
92
+
93
+ commit-changes :
94
+ needs : [build-linux, build-macos, build-windows]
95
+ runs-on : ubuntu-latest
96
+
97
+ permissions :
98
+ contents : write
99
+
100
+ steps :
101
+ - name : Check out repository
102
+
103
+ with :
104
+ fetch-depth : 0
105
+
106
+ - name : Download all build artifacts
107
+
108
+ with :
109
+ path : artifacts/
110
+
111
+ - name : Move artifacts to build directory
117
112
run : |
118
- mkdir UnityPackage/Libs/Windows
119
- mkdir RhythmGameUtilities/Libs/Windows
120
- cp build/libRhythmGameUtilities.dll UnityPackage/Libs/Windows
121
- cp build/libRhythmGameUtilities.dll RhythmGameUtilities/Libs/Windows
113
+ mkdir -p UnityPackage/Libs/Linux
114
+ mkdir -p RhythmGameUtilities/Libs/Linux
115
+ mkdir -p UnityPackage/Libs/macOS
116
+ mkdir -p RhythmGameUtilities/Libs/macOS
117
+ mkdir -p UnityPackage/Libs/Windows
118
+ mkdir -p RhythmGameUtilities/Libs/Windows
119
+ cp artifacts/build-linux-files/libRhythmGameUtilities.so UnityPackage/Libs/Linux/
120
+ cp artifacts/build-linux-files/libRhythmGameUtilities.so RhythmGameUtilities/Libs/Linux/
121
+ cp artifacts/build-macos-files/libRhythmGameUtilities.dylib UnityPackage/Libs/macOS/
122
+ cp artifacts/build-macos-files/libRhythmGameUtilities.dylib RhythmGameUtilities/Libs/macOS/
123
+ cp artifacts/build-windows-files/libRhythmGameUtilities.dll UnityPackage/Libs/Windows/
124
+ cp artifacts/build-windows-files/libRhythmGameUtilities.dll RhythmGameUtilities/Libs/Windows/
122
125
123
126
- name : Setup git
124
- shell : cmd
125
127
run : |
126
128
git config user.name 'github-actions[bot]'
127
129
git config user.email 'github-actions[bot]@users.noreply.github.com'
128
130
129
131
- name : Git commit changes
130
- shell : cmd
131
132
run : |
132
133
git pull
133
- git add UnityPackage/Libs/Windows/libRhythmGameUtilities.dll
134
- git add RhythmGameUtilities/Libs/Windows/libRhythmGameUtilities.dll
135
- git commit -m "Updated libRhythmGameUtilities.dll [skip ci]" || exit 0
134
+ git add UnityPackage/
135
+ git add RhythmGameUtilities/
136
+ git commit -m "Updated build files [skip ci]" || exit 0
136
137
git push
0 commit comments