Skip to content

Commit b311faf

Browse files
committed
Update build.yml
1 parent 588a70f commit b311faf

File tree

1 file changed

+83
-120
lines changed

1 file changed

+83
-120
lines changed

.github/workflows/build.yml

Lines changed: 83 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Build
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- 'feature/**'
88
pull_request:
99
branches:
10-
- master
10+
- main
1111

1212
jobs:
1313
Build:
@@ -18,78 +18,87 @@ jobs:
1818
matrix:
1919
config:
2020
#Linux-aarch64
21-
- os: ubuntu-24.04-arm
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'
8282
run: |
8383
#source_version=$(cat /etc/apt/sources.list | grep "main restricted" | head -1 | sed -e 's/.*com\/ //' -e 's/ main.*//')
8484
#echo "Found: ${ source_version }"
85+
sudo sed -Ei 's/^deb /deb \[arch=amd64\,i386\] /' /etc/apt/sources.list
86+
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy main restricted" | sudo tee -a /etc/apt/sources.list
87+
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
88+
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy universe" | sudo tee -a /etc/apt/sources.list
89+
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates universe" | sudo tee -a /etc/apt/sources.list
90+
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy multiverse" | sudo tee -a /etc/apt/sources.list
91+
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list
92+
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
93+
94+
sudo dpkg --add-architecture arm64
8595
sudo apt-get update
86-
96+
8797
- name: Dependencies - Linux-aarch64
8898
if: matrix.config.name == 'Linux-aarch64'
8999
run: |
90100
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
91-
#sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
92-
sudo apt-get install procps:arm64 mesa-common-dev:arm64 libglu1-mesa:arm64 libglu1-mesa-dev:arm64 libgl1:arm64 libgl1-mesa-dev:arm64 libglfw3-dev:arm64 cmake
101+
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
93102
sudo apt-get install openjdk-11-jdk
94103
sudo apt-get install libpython3-dev:arm64
95104
@@ -99,37 +108,37 @@ jobs:
99108
JAVA_HOME: '/usr/lib/jvm/java-11-openjdk-amd64'
100109
run: |
101110
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"
102-
111+
103112
- name: Build - Linux-aarch64
104113
if: matrix.config.name == 'Linux-aarch64'
105114
env:
106115
JAVA_HOME: '/usr/lib/jvm/java-11-openjdk-amd64'
107116
run: |
108117
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
109-
118+
110119
#Linux-64
111120
- name: Dependencies - Linux-64
112121
if: matrix.config.name == 'Linux-64'
113122
run: |
114123
sudo apt-get update
115-
sudo apt-get install procps mesa-common-dev libglu1-mesa libglu1-mesa-dev libgl1 libgl1-mesa-dev libpython3-dev clang cmake g++
116-
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+
117126
- name: CMake Generate Build Files - Linux-64
118127
if: matrix.config.name == 'Linux-64'
119128
run: |
120129
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"
121-
130+
122131
- name: Build - Linux-64
123132
if: matrix.config.name == 'Linux-64'
124133
run: |
125134
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
126-
135+
127136
#MacOS-64
128137
- name: CMake Generate Build Files - MacOS-64
129138
if: matrix.config.name == 'MacOS-64'
130139
run: |
131140
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"
132-
141+
133142
- name: Build - MacOS-64
134143
if: matrix.config.name == 'MacOS-64'
135144
run: |
@@ -145,7 +154,7 @@ jobs:
145154
if: matrix.config.name == 'MacOS-aarch64'
146155
run: |
147156
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
148-
157+
149158
#Windows-32
150159
- name: Dependencies - Windows-32
151160
if: matrix.config.name == 'Windows-32'
@@ -170,7 +179,7 @@ jobs:
170179
set MSYSTEM=MINGW32
171180
MINGW_INSTALLS=MINGW32
172181
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
173-
182+
174183
#Windows-64
175184
- name: Dependencies - Windows-64
176185
if: matrix.config.name == 'Windows-64'
@@ -211,101 +220,55 @@ jobs:
211220
path: '${{ github.workspace }}/cmake-build-release/${{ matrix.config.release }}'
212221

213222
Release:
214-
runs-on: ${{ matrix.config.os }}
215-
strategy:
216-
fail-fast: true
217-
matrix:
218-
config:
219-
- os: windows-latest
220-
target_release_repo: Reflection
221-
223+
runs-on: ubuntu-latest
224+
needs: [Build]
225+
if: github.event_name == 'push' && github.repository_owner == 'WaspScripts'
226+
222227
steps:
223-
- name: Wait For Builds
224-
if: github.event_name == 'push'
225-
uses: Brandon-T/wait-for-check-action@v1
226-
with:
227-
github_token: ${{ secrets.GITHUB_TOKEN }}
228-
check_names: '["Linux-aarch64", "Linux-64", "MacOS-64", "MacOS-aarch64", "Windows-32", "Windows-64"]'
229-
statuses: '["completed", "completed", "completed", "completed", "completed", "completed"]'
230-
conclusions: '["success", "success", "success", "success", "success", "success"]'
231-
timeout: 600
232-
poll_interval: 10
233-
234-
- name: Gather Release Notes
235-
id: release_notes
236-
if: github.event_name == 'push'
237-
run: |
238-
if [ "${{ github.event_name }}" = "push" ]; then
239-
commit="${{ github.event.head_commit.message }}"
240-
author="${{ github.event.head_commit.author.name }}"
241-
notes="${commit}<br /><br />- ${author}"
242-
notes="${notes//\\n/<br />}"
243-
notes="${notes//$'\n'/<br />}"
244-
elif [ "${{ github.event_name }}" = "pull_request" ]; then
245-
commit="${{ github.event.pull_request.title }}"
246-
body="${{ github.event.pull_request.body }}"
247-
author="${{ github.event.pull_request.author }}"
248-
notes="${commit}<br />${body}<br /><br />- ${author}"
249-
notes="${notes//\\n/<br />}"
250-
notes="${notes//$'\n'/<br />}"
251-
fi
252-
echo ::set-output name=description::"${notes}"
253-
shell: bash
254-
255-
- name: Download Artifacts
256-
if: github.event_name == 'push'
257-
uses: actions/download-artifact@v4
258-
with:
259-
pattern: 'artifact-*'
260-
path: 'artifact'
261-
merge-multiple: true
228+
- name: Checkout repository
229+
uses: actions/checkout@v4.2.2
230+
with:
231+
ref: main
262232

263-
- name: List Artifacts
264-
run: |
265-
ls artifact
233+
- name: Set up Git
234+
run: |
235+
git config --global user.name "Wasp Bot"
236+
git config --global user.email "waspbot@waspcripts.com"
266237
267-
- name: Upload Autobuild
268-
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')
269-
uses: Brandon-T/update-release-action@v1
270-
with:
271-
github_token: ${{ secrets.CI_RELEASE_TOKEN }}
272-
release_name: 'Auto-Build'
273-
file: 'artifact/*'
274-
is_file_glob: true
275-
overwrite: true
276-
release_notes: ${{ steps.release_notes.outputs.description }}
277-
deletes_existing_release: true
278-
pre_release: false
279-
prefix_branch_name: false
280-
suffix_branch_name: false
281-
draft_release: false
282-
retry_count: 2
283-
retry_delay: 5
284-
owner: '${{ github.repository_owner }}'
285-
repo: '${{ matrix.config.target_release_repo }}'
286-
tag: 'autobuild'
287-
bump_tag: true
288-
ref: 'master'
289-
290-
- name: Upload Release Build
291-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
292-
uses: Brandon-T/update-release-action@v1
293-
with:
294-
github_token: ${{ secrets.CI_RELEASE_TOKEN }}
295-
release_name: ${{ steps.release_notes.outputs.version }}
296-
file: 'artifact/*'
297-
is_file_glob: true
298-
overwrite: true
299-
release_notes: ${{ steps.release_notes.outputs.description }}
300-
deletes_existing_release: false
301-
pre_release: false
302-
prefix_branch_name: false
303-
suffix_branch_name: false
304-
draft_release: false
305-
retry_count: 2
306-
retry_delay: 5
307-
owner: '${{ github.repository_owner }}'
308-
repo: '${{ matrix.config.target_release_repo }}'
309-
tag: ${{ steps.release_notes.outputs.version }}
310-
bump_tag: true
311-
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

Comments
 (0)