Skip to content

Commit

Permalink
REVIEWED: Some template files
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Oct 15, 2024
1 parent a79e200 commit 5b87f08
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 139 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ on:
- '.github/workflows/linux.yml'
release:
types: [published]

permissions:
contents: read

jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: ubuntu-20.04

env:
PROJECT_NAME: ${{ github.event.repository.name }}
PROJECT_BUILD_PATH: ${{ github.event.repository.name }}/src
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_linux_x64
PROJECT_SOURCES: "project_name.c"
PROJECT_CUSTOM_FLAGS: ""
PROJECT_RESOURCES_PATH: resources

steps:
- name: Checkout this repo
Expand Down Expand Up @@ -55,12 +60,13 @@ jobs:
- name: Build Product
run: |
cd ${{ env.PROJECT_NAME }}/src
make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_SOURCE_FILES=${{ env.PROJECT_SOURCES }} PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_PATH=../../raylib
make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src
- name: Generate Artifacts
run: |
ls ${{ env.PROJECT_BUILD_PATH }}
cp ${{ env.PROJECT_BUILD_PATH }}/${{ env.PROJECT_NAME }} ${{ env.PROJECT_RELEASE_PATH }}
cp -r ${{ env.PROJECT_NAME }}/${{ env.PROJECT_RESOURCES_PATH }} ${{ env.PROJECT_RELEASE_PATH }}
cp ${{ env.PROJECT_NAME }}/README.md ${{ env.PROJECT_RELEASE_PATH }}
cp ${{ env.PROJECT_NAME }}/LICENSE ${{ env.PROJECT_RELEASE_PATH }}
ls ${{ env.PROJECT_RELEASE_PATH }}
Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
paths:
- 'src/**'
- '.github/workflows/linux.yml'
- '.github/workflows/macos.yml'
release:
types: [published]

Expand All @@ -20,12 +20,10 @@ jobs:

env:
PROJECT_NAME: ${{ github.event.repository.name }}
PROJECT_FILE_NAME: raylib_game
PROJECT_BUILD_PATH: ${{ github.event.repository.name }}/src
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_macos
PROJECT_SOURCES: "raylib_game.c"
PROJECT_CUSTOM_FLAGS: ""
RAYLIB_CONFIG_FLAGS: "-DSUPPORT_MODULE_RSHAPES -DSUPPORT_MODULE_RTEXTURES -DSUPPORT_MODULE_RTEXT -DSUPPORT_MODULE_RAUDIO -DSUPPORT_COMPRESSION_API -DSUPPORT_QUADS_DRAW_MODE -DSUPPORT_IMAGE_MANIPULATION -DSUPPORT_DEFAULT_FONT -DSUPPORT_TEXT_MANIPULATION -DSUPPORT_FILEFORMAT_WAV -DSUPPORT_FILEFORMAT_QOA -DSUPPORT_FILEFORMAT_MP3 -DSUPPORT_FILEFORMAT_OGG -DSUPPORT_FILEFORMAT_FLAC -DSUPPORT_STANDARD_FILEIO -DSUPPORT_TRACELOG"
PROJECT_RESOURCES_PATH: resources

steps:
- name: Checkout this repo
Expand All @@ -49,8 +47,8 @@ jobs:
run: |
mkdir ${{ env.PROJECT_RELEASE_PATH }}
cd ${{ env.PROJECT_RELEASE_PATH }}
mkdir ${{ env.PROJECT_FILE_NAME }}.app
cd ${{ env.PROJECT_FILE_NAME }}.app
mkdir ${{ env.PROJECT_NAME }}.app
cd ${{ env.PROJECT_NAME }}.app
mkdir Contents
cd Contents
mkdir MacOS
Expand Down Expand Up @@ -92,27 +90,28 @@ jobs:
# Build project x86_64 binary
# TODO: Link with x86_64 raylib library: libraylib_x86_64.a
make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_SOURCE_FILES=${{ env.PROJECT_SOURCES }} PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_PATH=../../raylib PROJECT_CUSTOM_FLAGS="-target x86_64-apple-macos10.12"
mv -v -f ${{ env.PROJECT_FILE_NAME }} ${{ env.PROJECT_FILE_NAME }}_x86_64
make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src PROJECT_CUSTOM_FLAGS="-target x86_64-apple-macos10.12"
mv -v -f ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_x86_64
make clean
# Build project arm64 binary
# TODO: Link with arm64 raylib library: libraylib_arm.a
make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_SOURCE_FILES=${{ env.PROJECT_SOURCES }} PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_PATH=../../raylib PROJECT_CUSTOM_FLAGS="-target arm64-apple-macos11"
mv -v -f ${{ env.PROJECT_FILE_NAME }} ${{ env.PROJECT_FILE_NAME }}_arm64
make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src PROJECT_CUSTOM_FLAGS="-target arm64-apple-macos11"
mv -v -f ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_arm64
make clean
# Join x86_64 and arm64 binaries
lipo -create -output ${{ env.PROJECT_FILE_NAME }} ${{ env.PROJECT_FILE_NAME }}_x86_64 ${{ env.PROJECT_FILE_NAME }}_arm64
lipo ${{ env.PROJECT_FILE_NAME }} -detailed_info
lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_x86_64 ${{ env.PROJECT_NAME }}_arm64
lipo ${{ env.PROJECT_NAME }} -detailed_info
cd ..
- name: Generate Artifacts
run: |
ls ${{ env.PROJECT_BUILD_PATH }}
cp ${{ env.PROJECT_BUILD_PATH }}/${{ env.PROJECT_FILE_NAME }} ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_FILE_NAME }}.app/Contents/MacOS
cp ${{ env.PROJECT_NAME }}/src/raylib.icns ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_FILE_NAME }}.app/Contents/Resources
cp ${{ env.PROJECT_NAME }}/src/Info.plist ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_FILE_NAME }}.app/Contents
cp ${{ env.PROJECT_BUILD_PATH }}/${{ env.PROJECT_NAME }} ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents/MacOS
cp ${{ env.PROJECT_NAME }}/src/${{ env.PROJECT_NAME }}.icns ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents/Resources
cp ${{ env.PROJECT_NAME }}/src/Info.plist ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents
cp -r ${{ env.PROJECT_NAME }}/${{ env.PROJECT_RESOURCES_PATH }} ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents
cp ${{ env.PROJECT_NAME }}/README.md ${{ env.PROJECT_RELEASE_PATH }}
cp ${{ env.PROJECT_NAME }}/LICENSE ${{ env.PROJECT_RELEASE_PATH }}
ls ${{ env.PROJECT_RELEASE_PATH }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ on:
- '.github/workflows/webassembly.yml'
release:
types: [published]

permissions:
contents: read

jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: windows-latest

env:
PROJECT_NAME: ${{ github.event.repository.name }}
PROJECT_BUILD_PATH: ${{ github.event.repository.name }}\\src
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_wasm
PROJECT_SOURCES: raylib_game.c
BUILD_WEB_SHELL: minshell.html

steps:
- name: Checkout this repo
Expand Down Expand Up @@ -58,7 +61,7 @@ jobs:
- name: Build Product
run: |
cd ${{ env.PROJECT_NAME }}/src
make PLATFORM=PLATFORM_WEB BUILD_MODE=RELEASE EMSDK_PATH="D:/a/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}/emsdk-cache/emsdk-main" PROJECT_SOURCE_FILES=${{ env.PROJECT_SOURCES }} PROJECT_BUILD_PATH=. RAYLIB_PATH=../../raylib -B
make PLATFORM=PLATFORM_WEB BUILD_MODE=RELEASE EMSDK_PATH="D:/a/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}/emsdk-cache/emsdk-main" PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src -B
- name: Generate Artifacts
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ on:
- '.github/workflows/windows.yml'
release:
types: [published]

permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: windows-latest

env:
PROJECT_NAME: ${{ github.event.repository.name }}
PROJECT_BUILD_PATH: "${{ github.event.repository.name }}\\projects\\VS2022\\build\\${{ github.event.repository.name }}\\bin\\x64\\Release"
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_win_x64
PROJECT_RESOURCES_PATH: resources

steps:
- name: Checkout this repo
Expand Down Expand Up @@ -53,14 +58,15 @@ jobs:
run: |
dir
cd ${{ env.PROJECT_NAME }}/projects/VS2022
msbuild.exe ${{ env.PROJECT_NAME }}.sln /target:${{ env.PROJECT_NAME }} /property:Configuration=Release /property:Platform=x64
msbuild.exe ${{ env.PROJECT_NAME }}.sln /target:${{ env.PROJECT_NAME }} /property:Configuration=Release /property:Platform=x64 /property:RaylibSrcPath="..\..\..\..\raylib\src"
cd ../..
shell: cmd

- name: Generate Artifacts
run: |
dir ${{ env.PROJECT_BUILD_PATH }}
copy /Y ${{ env.PROJECT_BUILD_PATH }}\${{ env.PROJECT_NAME }}.exe ${{ env.PROJECT_RELEASE_PATH }}\${{ env.PROJECT_NAME }}.exe
xcopy ${{ env.PROJECT_NAME }}\${{ env.PROJECT_RESOURCES_PATH }} ${{ env.PROJECT_RELEASE_PATH }}\${{ env.PROJECT_RESOURCES_PATH }} /s /e /i
copy /Y ${{ env.PROJECT_NAME }}\README.md ${{ env.PROJECT_RELEASE_PATH }}\README.md
copy /Y ${{ env.PROJECT_NAME }}\LICENSE ${{ env.PROJECT_RELEASE_PATH }}\LICENSE
dir ${{ env.PROJECT_RELEASE_PATH }}
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,13 @@ dkms.conf
*.aps
.vs

# Clangd LSP
.cache
compile_commands.json

# Build folder
[Bb]uild

# Android
*apk*
android.*
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021-2022 Ramon Santamaria (@raysan5)
Copyright (c) 2021-2024 Ramon Santamaria (@raysan5)

This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ _Copyright (c) 2022-2024 Ramon Santamaria ([@raysan5](https://twitter.com/raysan

### Description

$(Your Game Description)
$(Your Project Description)

### Features

- $(Game Feature 01)
- $(Game Feature 02)
- $(Game Feature 03)
- $(Project Feature 01)
- $(Project Feature 02)
- $(Project Feature 03)

### Controls

Keyboard:
- $(Game Control 01)
- $(Game Control 02)
- $(Game Control 03)
Keyboard/Mouse:
- $(Project Controls 01)
- $(Project Controls 02)
- $(Project Controls 03)

### Screenshots

Expand All @@ -79,7 +79,7 @@ _TODO: Show your game to the world, animated GIFs recommended!._

### License

This game sources are licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.
This project sources are licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.

$(Additional Licenses)

Expand Down
Loading

0 comments on commit 5b87f08

Please sign in to comment.