Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
469c4f7
debug print the working directory
JohnnyCena123 Aug 19, 2025
0d23000
trigger it on any branch (temporarily)
JohnnyCena123 Aug 19, 2025
4d18313
nope, wrong fix
JohnnyCena123 Aug 19, 2025
e20faf7
dummy commit to trigger the workflow
JohnnyCena123 Aug 19, 2025
b2f8b53
lets see if this works
JohnnyCena123 Aug 19, 2025
1879f09
trigger the workflow when updating it
JohnnyCena123 Aug 19, 2025
904f209
nice typo
JohnnyCena123 Aug 19, 2025
dad6f54
add missing dollar signs
JohnnyCena123 Aug 19, 2025
62cea34
debug list the contents of the repository
JohnnyCena123 Aug 19, 2025
05807a0
dir/s instead of ls
JohnnyCena123 Aug 19, 2025
6fe454e
remove this, no longer needed
JohnnyCena123 Aug 19, 2025
e0a7cf9
backslashes maybe? windows...
JohnnyCena123 Aug 19, 2025
cb8b3a5
this should be a forward slash
JohnnyCena123 Aug 19, 2025
accbdf7
remove no longer needed spam
JohnnyCena123 Aug 19, 2025
6614425
debug check if examples dir exists
JohnnyCena123 Aug 19, 2025
7d55566
LOG is disabled apparently
JohnnyCena123 Aug 19, 2025
8a6d994
...
JohnnyCena123 Aug 19, 2025
a4d2b96
temporarily disable this step to save time
JohnnyCena123 Aug 19, 2025
0b03c1d
ubuntu maybe
JohnnyCena123 Aug 19, 2025
ee41556
bash
JohnnyCena123 Aug 19, 2025
ff99f4d
install deps
JohnnyCena123 Aug 19, 2025
9b93605
link libc
JohnnyCena123 Aug 19, 2025
e23e8fb
link libm
JohnnyCena123 Aug 19, 2025
d05cdfd
now to test the rest
JohnnyCena123 Aug 19, 2025
899c8e4
emsdk is back
JohnnyCena123 Aug 19, 2025
bd4072b
add missing shaders
JohnnyCena123 Aug 20, 2025
f54d586
Update examples collection
github-actions[bot] Aug 20, 2025
8f62492
add indentation
JohnnyCena123 Aug 20, 2025
5485d22
Merge branch 'update-examples-fix' of https://github.com/JohnnyCena12…
JohnnyCena123 Aug 20, 2025
5c4ca70
remove emsdk cache
JohnnyCena123 Aug 20, 2025
54764ca
ignore emsdk cache
JohnnyCena123 Aug 20, 2025
e0920a1
Update examples collection
github-actions[bot] Aug 20, 2025
546e176
fix errors with the find command
JohnnyCena123 Aug 20, 2025
6b53052
Merge branch 'update-examples-fix' of https://github.com/JohnnyCena12…
JohnnyCena123 Aug 20, 2025
e3d8c3b
remove emsdk cache now
JohnnyCena123 Aug 20, 2025
7dd45d2
i forgot to actually add it to gitignore
JohnnyCena123 Aug 20, 2025
62afeca
fix error with git not finding anything to commit
JohnnyCena123 Aug 20, 2025
c2f3c36
global config instead of repo specific
JohnnyCena123 Aug 20, 2025
cfd3aea
Merge remote-tracking branch 'origin/master' into update-examples-fix
JohnnyCena123 Aug 20, 2025
a1ec042
clone raylib.com repo under the same owner as the raylib repo owner
JohnnyCena123 Aug 20, 2025
8427023
add proper access token
JohnnyCena123 Aug 20, 2025
acf19a6
reorganize it all
JohnnyCena123 Aug 20, 2025
7202132
Merge remote-tracking branch 'origin/master' into update-examples-fix
JohnnyCena123 Aug 20, 2025
0b61788
remove text_unicode_font as it no longer exists
JohnnyCena123 Aug 20, 2025
7341326
run rexm update
JohnnyCena123 Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 53 additions & 38 deletions .github/workflows/update_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ on:
workflow_dispatch:
push:
paths:
- '.github/workflows/update_examples.yml'
- 'examples/**'
- 'tools/rexm/**'
pull_request:
paths:
- '.github/workflows/update_examples.yml'
- 'examples/**'
- 'tools/rexm/**'

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout
Expand All @@ -22,49 +26,60 @@ jobs:
with:
version: 'latest'
actions-cache-folder: 'emsdk-cache'

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Clone raylib.com repo to update files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone https://x-access-token:${GITHUB_TOKEN}@github.com/raysan5/raylib.com.git
shell: cmd

- name: Build and run rexm tool (VS2022 solution)

- name: Build and run rexm tool (GNU Makefile)
# rexm should update all required files in raylib and even raylib.com repo,
# but not sure if it can do that from an Action, maybe it requires manual copy
run: |
cd tools/rexm/VS2022
msbuild.exe rexm.sln /target:rexm /property:Configuration=Release /property:Platform=x64
cd ../../..
set REXM_EXAMPLES_BASE_PATH="examples"
set REXM_EXAMPLES_WEB_PATH="../raylib.com/examples"
set REXM_EXAMPLES_TEMPLATE_FILE_PATH="examples/examples_template.c"
set REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH="examples/examples_template.png"
set REXM_EXAMPLES_COLLECTION_FILE_PATH="examples/examples_list.txt"
set REXM_EXAMPLES_VS2022_SLN_FILE="projects/VS2022/raylib.sln"
set EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main"
.\tools\rexm\VS2022\build\rexm\bin\x64\Release\rexm.exe update
sudo apt-get update && sudo apt-get install -y libopengl0 libglu1-mesa libx11-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libgl1-mesa-dev libglu1-mesa-dev
cd "${{ github.workspace }}/src"
make
sudo make install
cd ../tools/rexm/
clang rexm.c -lraylib -lc -lm -o rexm
export REXM_EXAMPLES_BASE_PATH="${{ github.workspace }}/examples"
export REXM_EXAMPLES_WEB_PATH="${{ github.workspace }}/../raylib.com/examples"
export REXM_EXAMPLES_TEMPLATE_FILE_PATH="${{ github.workspace }}examples/examples_template.c"
export REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH="${{ github.workspace }}examples/examples_template.png"
export REXM_EXAMPLES_COLLECTION_FILE_PATH="${{ github.workspace }}/examples/examples_list.txt"
export REXM_EXAMPLES_VS2022_SLN_FILE="${{ github.workspace }}/projects/VS2022/raylib.sln"
export EMSDK_PATH="${{ github.workspace }}/emsdk-cache/emsdk-main"
./rexm update
cd ../..
shell: cmd
shell: bash

- name: Commit changes to raylib repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
#git config user.name "github-actions[bot]"
#git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
#git add -A
#git commit -m "Update examples collection"
#git push
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Update examples collection" || echo "git exited with code 1, nothing changed"
git push
shell: bash

- name: Build examples
run: |
cd "${{ github.workspace }}/src"
make clean
make PLATFORM=PLATFORM_WEB
cd ../examples
make PLATFORM=PLATFORM_WEB
for category in core shapes textures models shaders text audio; do
cd $category
target_dir="${{ github.workspace }}/../raylib.com/examples/$category/"
find . -type f -name "*.wasm" -exec cp {} "$target_dir" \;
find . -type f -name "*.html" -exec cp {} "$target_dir" \;
find . -type f -name "*.js" -exec cp {} "$target_dir" \;
find . -type f -name "*.data" -exec cp {} "$target_dir" \;
cd ..
done
- name: Push changes to raylib.com repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
#git config --global user.name "github-actions[bot]"
#git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
#git add examples
#git commit -m "Update web examples"
#git push origin
git clone https://x-access-token:${{ secrets.RAYLIB_DOT_COM_REPO_TOKEN }}@github.com/$GITHUB_REPOSITORY_OWNER/raylib.com.git
cd raylib.com
git add examples
git commit -m "Update web examples"
git push origin
shell: bash
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ tools/parser/raylib_parser
tools/rexm/rexm.exe
tools/rexm/rexm

# emsdk cache for GitHub Actions runners
emsdk-cache/
1 change: 1 addition & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ TEXT = \
text/text_raylib_fonts \
text/text_rectangle_bounds \
text/text_unicode \
text/text_unicode_ranges \
text/text_writing_anim

MODELS = \
Expand Down
21 changes: 13 additions & 8 deletions examples/Makefile.Web
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ TEXT = \
text/text_raylib_fonts \
text/text_rectangle_bounds \
text/text_unicode \
text/text_unicode_ranges \
text/text_writing_anim

MODELS = \
Expand Down Expand Up @@ -999,14 +1000,14 @@ text/text_input_box: text/text_input_box.c

text/text_raylib_fonts: text/text_raylib_fonts.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file text/resources/fonts/alagard.png@resources/fonts/alagard.png \
--preload-file text/resources/fonts/pixelplay.png@resources/fonts/pixelplay.png \
--preload-file text/resources/fonts/mecha.png@resources/fonts/mecha.png \
--preload-file text/resources/fonts/setback.png@resources/fonts/setback.png \
--preload-file text/resources/fonts/romulus.png@resources/fonts/romulus.png \
--preload-file text/resources/fonts/pixantiqua.png@resources/fonts/pixantiqua.png \
--preload-file text/resources/fonts/alpha_beta.png@resources/fonts/alpha_beta.png \
--preload-file text/resources/fonts/jupiter_crash.png@resources/fonts/jupiter_crash.png
--preload-file text/resources/sprite_fonts/alagard.png@resources/sprite_fonts/alagard.png \
--preload-file text/resources/sprite_fonts/pixelplay.png@resources/sprite_fonts/pixelplay.png \
--preload-file text/resources/sprite_fonts/mecha.png@resources/sprite_fonts/mecha.png \
--preload-file text/resources/sprite_fonts/setback.png@resources/sprite_fonts/setback.png \
--preload-file text/resources/sprite_fonts/romulus.png@resources/sprite_fonts/romulus.png \
--preload-file text/resources/sprite_fonts/pixantiqua.png@resources/sprite_fonts/pixantiqua.png \
--preload-file text/resources/sprite_fonts/alpha_beta.png@resources/sprite_fonts/alpha_beta.png \
--preload-file text/resources/sprite_fonts/jupiter_crash.png@resources/sprite_fonts/jupiter_crash.png

text/text_rectangle_bounds: text/text_rectangle_bounds.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
Expand All @@ -1017,6 +1018,10 @@ text/text_unicode: text/text_unicode.c
--preload-file text/resources/noto_cjk.fnt@resources/noto_cjk.fnt \
--preload-file text/resources/symbola.fnt@resources/symbola.fnt

text/text_unicode_ranges: text/text_unicode_ranges.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file text/resources/NotoSansTC-Regular.ttf@resources/NotoSansTC-Regular.ttf

text/text_writing_anim: text/text_writing_anim.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

Expand Down
5 changes: 3 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You may find it easier to use than other toolchains, especially when it comes to
- `zig build [module]` to compile all examples for a module (e.g. `zig build core`)
- `zig build [example]` to compile _and run_ a particular example (e.g. `zig build core_basic_window`)

## EXAMPLES COLLECTION [TOTAL: 161]
## EXAMPLES COLLECTION [TOTAL: 162]

### category: core [37]

Expand Down Expand Up @@ -122,7 +122,7 @@ Examples using raylib textures functionality, including image/textures loading/g
| [textures_image_rotate](textures/textures_image_rotate.c) | <img src="textures/textures_image_rotate.png" alt="textures_image_rotate" width="80"> | ⭐⭐☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
| [textures_textured_curve](textures/textures_textured_curve.c) | <img src="textures/textures_textured_curve.png" alt="textures_textured_curve" width="80"> | ⭐⭐⭐☆ | 4.5 | 4.5 | [Jeffery Myers](https://github.com/JeffM2501) |

### category: text [12]
### category: text [13]

Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/rtext.c) module.

Expand All @@ -140,6 +140,7 @@ Examples using raylib text functionality, including sprite fonts loading/generat
| [text_unicode](text/text_unicode.c) | <img src="text/text_unicode.png" alt="text_unicode" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
| [text_draw_3d](text/text_draw_3d.c) | <img src="text/text_draw_3d.png" alt="text_draw_3d" width="80"> | ⭐⭐⭐⭐️ | 3.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
| [text_codepoints_loading](text/text_codepoints_loading.c) | <img src="text/text_codepoints_loading.png" alt="text_codepoints_loading" width="80"> | ⭐⭐⭐☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
| [text_unicode_ranges](text/text_unicode_ranges.c) | <img src="text/text_unicode_ranges.png" alt="text_unicode_ranges" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |

### category: models [23]

Expand Down
1 change: 1 addition & 0 deletions examples/examples_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ others;easings_testbed;⭐️⭐️⭐️☆;2.5;3.0;"Juan Miguel López";@flash
others;raylib_opengl_interop;⭐️⭐️⭐️⭐️;3.8;4.0;"Stephan Soller";@arkanis
others;embedded_files_loading;⭐️⭐️☆☆;3.0;3.5;"Kristian Holmgren";@defutura
others;raymath_vector_angle;⭐️⭐️☆☆;1.0;4.6;"Ramon Santamaria";@raysan5
text;text_unicode_ranges;⭐⭐⭐⭐️;2.5;4.0;"Vlad Adrian";@demizdor
Loading
Loading