@@ -3,11 +3,11 @@ name: Build
33on :
44 push :
55 branches :
6- - master
6+ - main
77 - ' feature/**'
88 pull_request :
99 branches :
10- - master
10+ - main
1111
1212jobs :
1313 Build :
@@ -18,64 +18,64 @@ jobs:
1818 matrix :
1919 config :
2020 # Linux-aarch64
21- - os : ubuntu-latest
21+ - os : ubuntu-22.04
2222 name : Linux-aarch64
2323 other_linker_flags : ' -L/usr/aarch64-linux-gnu/local/lib'
2424 arch : aarch64
2525 output : libRemoteInput.so
26- release : libRemoteInput-aarch64 .so
26+ release : libremoteinput64 .so.aarch64
2727
2828 # Linux-64
2929 - os : ubuntu-latest
3030 name : Linux-64
3131 other_linker_flags : ' -m64'
3232 arch : x86_64
3333 output : libRemoteInput.so
34- release : libRemoteInput-x86_64 .so
34+ release : libremoteinput64 .so
3535
3636 # MacOS-64
3737 - os : macos-13 # macos-latest
3838 name : MacOS-64
3939 other_linker_flags : ' -m64'
4040 arch : x86_64
4141 output : libRemoteInput.dylib
42- release : libRemoteInput-x86_64 .dylib
42+ release : libremoteinput64 .dylib
4343
4444 # MacOS-aarch64
4545 - os : macos-latest
4646 name : MacOS-aarch64
4747 other_linker_flags : ' -m64'
4848 arch : aarch64
4949 output : libRemoteInput.dylib
50- release : libRemoteInput-aarch64 .dylib
50+ release : libremoteinput64 .dylib.aarch64
5151
5252 # Windows-32
5353 - os : windows-latest
5454 name : Windows-32
5555 other_linker_flags : ' -m32'
5656 arch : i686
5757 output : libRemoteInput.dll
58- release : libRemoteInput-i686 .dll
58+ release : libremoteinput32 .dll
5959
6060 # Windows-64
6161 - os : windows-latest
6262 name : Windows-64
6363 other_linker_flags : ' -m64'
6464 arch : x86_64
6565 output : libRemoteInput.dll
66- release : libRemoteInput-x86_64 .dll
67-
66+ release : libremoteinput64 .dll
67+
6868 steps :
69- - uses : actions/checkout@v1
69+ - uses : actions/checkout@v4.2.2
7070 with :
7171 submodules : true
72-
72+
7373 - name : Set up Python
7474 if : matrix.config.name != 'Linux-aarch64'
7575 uses : actions/setup-python@v4
7676 with :
7777 python-version : ' 3.x'
78-
78+
7979 # Linux-aarch64
8080 - name : Update Sources - Linux-aarch64
8181 if : matrix.config.name == 'Linux-aarch64'
@@ -90,15 +90,14 @@ jobs:
9090 echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy multiverse" | sudo tee -a /etc/apt/sources.list
9191 echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list
9292 echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
93-
93+
9494 sudo dpkg --add-architecture arm64
9595 sudo apt-get update
96-
96+
9797 - name : Dependencies - Linux-aarch64
9898 if : matrix.config.name == 'Linux-aarch64'
9999 run : |
100100 sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
101- #sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
102101 sudo apt-get install libprocps-dev:arm64 mesa-common-dev:arm64 libglu1-mesa:arm64 libglu1-mesa-dev:arm64 libgl1-mesa-glx:arm64 libgl1-mesa-dev:arm64 libglfw3-dev:arm64 cmake
103102 sudo apt-get install openjdk-11-jdk
104103 sudo apt-get install libpython3-dev:arm64
@@ -109,37 +108,37 @@ jobs:
109108 JAVA_HOME : ' /usr/lib/jvm/java-11-openjdk-amd64'
110109 run : |
111110 cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
112-
111+
113112 - name : Build - Linux-aarch64
114113 if : matrix.config.name == 'Linux-aarch64'
115114 env :
116115 JAVA_HOME : ' /usr/lib/jvm/java-11-openjdk-amd64'
117116 run : |
118117 cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
119-
118+
120119 # Linux-64
121120 - name : Dependencies - Linux-64
122121 if : matrix.config.name == 'Linux-64'
123122 run : |
124123 sudo apt-get update
125- sudo apt-get install libprocps -dev mesa-common-dev libglu1-mesa libglu1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev libpython3-dev clang cmake g++
126-
124+ sudo apt-get install libproc2 -dev mesa-common-dev libglu1-mesa libglu1-mesa-dev libgl1 libgl1-mesa-dev libpython3-dev clang cmake g++
125+
127126 - name : CMake Generate Build Files - Linux-64
128127 if : matrix.config.name == 'Linux-64'
129128 run : |
130129 cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
131-
130+
132131 - name : Build - Linux-64
133132 if : matrix.config.name == 'Linux-64'
134133 run : |
135134 cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
136-
135+
137136 # MacOS-64
138137 - name : CMake Generate Build Files - MacOS-64
139138 if : matrix.config.name == 'MacOS-64'
140139 run : |
141140 cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
142-
141+
143142 - name : Build - MacOS-64
144143 if : matrix.config.name == 'MacOS-64'
145144 run : |
@@ -155,7 +154,7 @@ jobs:
155154 if : matrix.config.name == 'MacOS-aarch64'
156155 run : |
157156 cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
158-
157+
159158 # Windows-32
160159 - name : Dependencies - Windows-32
161160 if : matrix.config.name == 'Windows-32'
@@ -180,7 +179,7 @@ jobs:
180179 set MSYSTEM=MINGW32
181180 MINGW_INSTALLS=MINGW32
182181 cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
183-
182+
184183 # Windows-64
185184 - name : Dependencies - Windows-64
186185 if : matrix.config.name == 'Windows-64'
@@ -221,101 +220,55 @@ jobs:
221220 path : ' ${{ github.workspace }}/cmake-build-release/${{ matrix.config.release }}'
222221
223222 Release :
224- runs-on : ${{ matrix.config.os }}
225- strategy :
226- fail-fast : true
227- matrix :
228- config :
229- - os : windows-latest
230- target_release_repo : Reflection
231-
223+ runs-on : ubuntu-latest
224+ needs : [Build]
225+ if : github.event_name == 'push' && github.repository_owner == 'WaspScripts'
226+
232227 steps :
233- - name : Wait For Builds
234- if : github.event_name == 'push'
235- uses : Brandon-T/wait-for-check-action@v1
236- with :
237- github_token : ${{ secrets.GITHUB_TOKEN }}
238- check_names : ' ["Linux-aarch64", "Linux-64", "MacOS-64", "MacOS-aarch64", "Windows-32", "Windows-64"]'
239- statuses : ' ["completed", "completed", "completed", "completed", "completed", "completed"]'
240- conclusions : ' ["success", "success", "success", "success", "success", "success"]'
241- timeout : 600
242- poll_interval : 10
243-
244- - name : Gather Release Notes
245- id : release_notes
246- if : github.event_name == 'push'
247- run : |
248- if [ "${{ github.event_name }}" = "push" ]; then
249- commit="${{ github.event.head_commit.message }}"
250- author="${{ github.event.head_commit.author.name }}"
251- notes="${commit}<br /><br />- ${author}"
252- notes="${notes//\\n/<br />}"
253- notes="${notes//$'\n'/<br />}"
254- elif [ "${{ github.event_name }}" = "pull_request" ]; then
255- commit="${{ github.event.pull_request.title }}"
256- body="${{ github.event.pull_request.body }}"
257- author="${{ github.event.pull_request.author }}"
258- notes="${commit}<br />${body}<br /><br />- ${author}"
259- notes="${notes//\\n/<br />}"
260- notes="${notes//$'\n'/<br />}"
261- fi
262- echo ::set-output name=description::"${notes}"
263- shell : bash
264-
265- - name : Download Artifacts
266- if : github.event_name == 'push'
267- uses : actions/download-artifact@v4
268- with :
269- pattern : ' artifact-*'
270- path : ' artifact'
271- merge-multiple : true
228+ - name : Checkout repository
229+ 230+ with :
231+ ref : main
272232
273- - name : List Artifacts
274- run : |
275- ls artifact
233+ - name : Set up Git
234+ run : |
235+ git config --global user.name "Wasp Bot"
236+ git config --global user.email "[email protected] " 276237
277- - name : Upload Autobuild
278- if : github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')
279- uses : Brandon-T/update-release-action@v1
280- with :
281- github_token : ${{ secrets.CI_RELEASE_TOKEN }}
282- release_name : ' Auto-Build'
283- file : ' artifact/*'
284- is_file_glob : true
285- overwrite : true
286- release_notes : ${{ steps.release_notes.outputs.description }}
287- deletes_existing_release : true
288- pre_release : false
289- prefix_branch_name : false
290- suffix_branch_name : false
291- draft_release : false
292- retry_count : 2
293- retry_delay : 5
294- owner : ' ${{ github.repository_owner }}'
295- repo : ' ${{ matrix.config.target_release_repo }}'
296- tag : ' autobuild'
297- bump_tag : true
298- ref : ' master'
299-
300- - name : Upload Release Build
301- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
302- uses : Brandon-T/update-release-action@v1
303- with :
304- github_token : ${{ secrets.CI_RELEASE_TOKEN }}
305- release_name : ${{ steps.release_notes.outputs.version }}
306- file : ' artifact/*'
307- is_file_glob : true
308- overwrite : true
309- release_notes : ${{ steps.release_notes.outputs.description }}
310- deletes_existing_release : false
311- pre_release : false
312- prefix_branch_name : false
313- suffix_branch_name : false
314- draft_release : false
315- retry_count : 2
316- retry_delay : 5
317- owner : ' ${{ github.repository_owner }}'
318- repo : ' ${{ matrix.config.target_release_repo }}'
319- tag : ${{ steps.release_notes.outputs.version }}
320- bump_tag : true
321- ref : ' master'
238+ - name : Get current date
239+ id : date
240+ run : |
241+ echo "CURRENT_YEAR=$(date +'%Y')" >> $GITHUB_ENV
242+ echo "CURRENT_MONTH=$(date +'%m')" >> $GITHUB_ENV
243+ echo "CURRENT_DAY=$(date +'%d')" >> $GITHUB_ENV
244+
245+ - name : Get commit hash
246+ id : commit-hash
247+ run : echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
248+
249+ - name : Download all build artifacts
250+ uses : actions/download-artifact@v4
251+ with :
252+ pattern : ' artifact-*'
253+ path : ' artifact'
254+ merge-multiple : true
255+
256+ - name : List downloaded files
257+ run : ls -R artifact
258+
259+ - name : Create version tag
260+ id : tag
261+ run : |
262+ TAG_NAME="$CURRENT_YEAR.$CURRENT_MONTH.$CURRENT_DAY-$COMMIT_HASH"
263+ echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
264+ git tag $TAG_NAME
265+ git push origin $TAG_NAME
266+
267+ - name : Create GitHub release
268+ env :
269+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
270+ run : |
271+ gh release create "$TAG_NAME" \
272+ --title "Release $TAG_NAME" \
273+ --notes "Automated build from commit $COMMIT_HASH" \
274+ artifact/*
0 commit comments