Skip to content

Commit 0ccca00

Browse files
committed
Merge branch 'dev'
2 parents 3e6f32a + 53455e0 commit 0ccca00

File tree

367 files changed

+25809
-13179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+25809
-13179
lines changed

.github/workflows/linux.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
name: Linux
2-
on: [push, pull_request, release]
1+
name: 🐧 Linux
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
39

410
jobs:
511
build:
@@ -9,25 +15,17 @@ jobs:
915
fail-fast: false
1016
matrix:
1117
config:
12-
- {
13-
name: "Ubuntu g++",
14-
os: ubuntu-latest,
15-
compiler: "g++"
16-
}
17-
- {
18-
name: "Ubuntu clang++",
19-
os: ubuntu-latest,
20-
compiler: "clang++"
21-
}
18+
- { name: "Ubuntu g++", os: ubuntu-latest, compiler: "g++" }
19+
- { name: "Ubuntu clang++", os: ubuntu-latest, compiler: "clang++" }
2220

2321
steps:
2422
- name: Checkout atta
25-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2624

2725
- name: Install dependencies
2826
run: |
2927
sudo apt-get update
30-
sudo apt-get install cmake xorg-dev curl
28+
sudo apt-get install cmake xorg-dev curl
3129
3230
- name: Build
3331
run: ./build.sh --jobs 2 --compiler ${{ matrix.config.compiler }}

.github/workflows/macos.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
name: MacOS
2-
on: [push, pull_request, release]
1+
name: 🍎 MacOS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
39

410
jobs:
511
build:
@@ -9,15 +15,11 @@ jobs:
915
fail-fast: false
1016
matrix:
1117
config:
12-
- {
13-
name: "MacOS Latest",
14-
os: macos-latest,
15-
build_type: "Release"
16-
}
18+
- { name: "MacOS Latest", os: macos-latest, build_type: "Release" }
1719

1820
steps:
1921
- name: Checkout atta
20-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2123

2224
- name: Install dependencies on macos
2325
if: startsWith(matrix.config.os, 'macos')

.github/workflows/updateReadmeButtons.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: Update readme buttons
1+
name: 📄 Update README
22

3-
on:
3+
on:
44
project_card:
55
types: [created, deleted, moved]
66
project:

.github/workflows/versioning.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: 🏷️ Auto Versioning
2+
3+
on:
4+
pull_request:
5+
types:
6+
- labeled # Runs when labels are added to the PR
7+
branches:
8+
- dev # Only run for PRs targeting the dev branch
9+
if: github.event.pull_request.merged == false # Skip if PR is already merged
10+
11+
jobs:
12+
versioning:
13+
name: Auto Versioning
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Fetch full history to enable merging
20+
21+
- name: Set up Git
22+
run: |
23+
git config --global user.name "github-actions[bot]"
24+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
25+
26+
- name: Get PR Labels
27+
id: labels
28+
uses: actions/github-script@v7
29+
with:
30+
script: |
31+
const labels = context.payload.pull_request.labels.map(label => label.name);
32+
console.log("PR Labels:", labels);
33+
return labels;
34+
35+
- name: Check if Version Label Exists
36+
id: check_version_label
37+
run: |
38+
if echo "${{ steps.labels.outputs.result }}" | grep -Eq "version:(major|minor|patch)"; then
39+
echo "run_versioning=true" >> $GITHUB_ENV
40+
else
41+
echo "::notice::No versioning label found. Skipping workflow."
42+
exit 0
43+
fi
44+
45+
- name: Merge `dev` into PR Branch
46+
if: env.run_versioning == 'true'
47+
run: |
48+
git fetch origin dev
49+
git checkout ${{ github.head_ref }}
50+
if git merge --no-edit origin/dev; then
51+
echo "Merge successful."
52+
else
53+
echo "::error::Merge conflict detected! Resolve conflicts manually."
54+
exit 1
55+
fi
56+
continue-on-error: false
57+
58+
- name: Get Current Version from `dev`
59+
if: env.run_versioning == 'true'
60+
run: |
61+
VERSION=$(git show origin/dev:CMakeLists.txt | sed -nE 's/project\(atta VERSION ([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
62+
63+
if [[ -z "$VERSION" ]]; then
64+
echo "::error::Failed to extract version from CMakeLists.txt"
65+
exit 1
66+
fi
67+
68+
echo "::notice::Current Version (from dev): $VERSION"
69+
echo "VERSION=$VERSION" >> $GITHUB_ENV
70+
71+
- name: Determine Version Increment
72+
if: env.run_versioning == 'true'
73+
run: |
74+
echo "::notice::PR Labels Found: ${{ steps.labels.outputs.result }}"
75+
if echo "${{ steps.labels.outputs.result }}" | grep -q "version:major"; then
76+
echo "increment=major" >> $GITHUB_ENV
77+
echo "::notice::Version Increment: major"
78+
elif echo "${{ steps.labels.outputs.result }}" | grep -q "version:minor"; then
79+
echo "increment=minor" >> $GITHUB_ENV
80+
echo "::notice::Version Increment: minor"
81+
else
82+
echo "increment=patch" >> $GITHUB_ENV
83+
echo "::notice::Version Increment: patch"
84+
fi
85+
86+
- name: Increment Version
87+
if: env.run_versioning == 'true'
88+
run: |
89+
IFS='.' read -r major minor patch <<< "$VERSION"
90+
91+
case "$increment" in
92+
major) major=$((major + 1)); minor=0; patch=0 ;;
93+
minor) minor=$((minor + 1)); patch=0 ;;
94+
patch) patch=$((patch + 1)) ;;
95+
esac
96+
97+
NEW_VERSION="$major.$minor.$patch"
98+
echo "::notice::New Version: $NEW_VERSION"
99+
100+
sed -i -E "s/(project\(atta VERSION) [0-9]+\.[0-9]+\.[0-9]+/\1 $NEW_VERSION/" CMakeLists.txt
101+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
102+
103+
- name: Commit Updated Version (If Changed)
104+
if: env.run_versioning == 'true'
105+
run: |
106+
git add CMakeLists.txt
107+
if git diff --staged --quiet; then
108+
echo "No changes to commit."
109+
else
110+
git commit -m "Chore: Bump version to $NEW_VERSION"
111+
git push origin ${{ github.head_ref }}
112+
fi
113+
114+
- name: Delete Old Tag (If Exists)
115+
if: env.run_versioning == 'true'
116+
run: |
117+
if git rev-parse "v$NEW_VERSION" >/dev/null 2>&1; then
118+
git push --delete origin "v$NEW_VERSION"
119+
git tag -d "v$NEW_VERSION"
120+
echo "Deleted existing tag v$NEW_VERSION."
121+
else
122+
echo "No existing tag v$NEW_VERSION found."
123+
fi
124+
125+
- name: Create and Push New Git Tag
126+
if: env.run_versioning == 'true'
127+
run: |
128+
# Fetch the PR title (single quotes to preserve special characters)
129+
PR_TITLE='${{ github.event.pull_request.title }}'
130+
# Fetch the PR number
131+
PR_NUMBER="${{ github.event.pull_request.number }}"
132+
echo "::notice::PR Title: $PR_TITLE"
133+
echo "::notice::PR Number: $PR_NUMBER"
134+
135+
# Create an annotated tag with the PR title as the description
136+
git tag -a "v$NEW_VERSION" -m "PR #$PR_NUMBER - $PR_TITLE"
137+
138+
# Push the tag to the remote repository
139+
git push origin "v$NEW_VERSION"

.github/workflows/web.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
name: Web
2-
on: [push, pull_request, release]
1+
name: 🕸️ Web
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
39

410
jobs:
511
build:
@@ -9,17 +15,13 @@ jobs:
915
fail-fast: false
1016
matrix:
1117
config:
12-
- {
13-
name: "Web Latest",
14-
os: ubuntu-latest,
15-
build_type: "Release"
16-
}
18+
- { name: "Web Latest", os: ubuntu-latest, build_type: "Release" }
1719

1820
steps:
19-
- uses: mymindstorm/setup-emsdk@v9
20-
21+
- uses: mymindstorm/setup-emsdk@v13
22+
2123
- name: Checkout atta
22-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2325

2426
- name: Configure
2527
run: |

.github/workflows/windows.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
name: Windows
2-
on: [push, pull_request, release]
1+
name: 🪟 Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
39

410
jobs:
511
build:
@@ -9,15 +15,11 @@ jobs:
915
fail-fast: false
1016
matrix:
1117
config:
12-
- {
13-
name: "Windows Latest",
14-
os: windows-latest,
15-
build_type: "Release"
16-
}
18+
- { name: "Windows Latest", os: windows-latest, build_type: "Release" }
1719

1820
steps:
1921
- name: Checkout atta
20-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2123

2224
- name: Install dependencies
2325
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ tags
2525
imgui.ini
2626

2727
# Debugging/Profile
28+
.cache/
2829
perf.*
2930
.gdb_history
3031
profile/
32+
compile_commands.json

0 commit comments

Comments
 (0)