Skip to content

Commit

Permalink
Try to fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bit69tream committed Dec 26, 2023
1 parent 2a1c738 commit 2e42b48
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@ on:
jobs:
build:
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: "raylib_game.c"
PROJECT_SOURCES: "sinister.c"
PROJECT_CUSTOM_FLAGS: ""

steps:
- name: Checkout this repo
uses: actions/checkout@master
with:
path: ${{ env.PROJECT_NAME }}

- name: Checkout raylib repo
uses: actions/checkout@v3
with:
repository: raysan5/raylib
path: raylib

- name: Setup Release Paths
run: |
echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_linux_x64" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'

- name: Setup Environment
run: |
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
mkdir ${{ env.PROJECT_RELEASE_PATH }}
ls
shell: bash

- name: Build raylib Library
run: |
cd raylib/src
Expand All @@ -72,7 +72,7 @@ jobs:
with:
name: ${{ env.PROJECT_RELEASE_PATH }}.zip
path: ./${{ env.PROJECT_RELEASE_PATH }}.zip

# Alternative: https://github.com/marketplace/actions/gh-release
- name: Upload Artifact to Release
uses: actions/[email protected]
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '.github/workflows/linux.yml'
release:
types: [published]

permissions:
contents: read

Expand All @@ -17,36 +17,36 @@ jobs:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: macos-latest

env:
PROJECT_NAME: ${{ github.event.repository.name }}
PROJECT_FILE_NAME: raylib_game
PROJECT_FILE_NAME: sinister
PROJECT_BUILD_PATH: ${{ github.event.repository.name }}/src
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_macos
PROJECT_SOURCES: "raylib_game.c"
PROJECT_SOURCES: "sinister.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"

steps:
- name: Checkout this repo
uses: actions/checkout@master
with:
path: ${{ env.PROJECT_NAME }}

- name: Checkout raylib repo
uses: actions/checkout@v3
with:
repository: raysan5/raylib
path: raylib

- name: Setup Release Paths
run: |
echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_macos" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'

- name: Setup Environment
run: |
run: |
mkdir ${{ env.PROJECT_RELEASE_PATH }}
cd ${{ env.PROJECT_RELEASE_PATH }}
mkdir ${{ env.PROJECT_FILE_NAME }}.app
Expand All @@ -58,29 +58,29 @@ jobs:
cd ../../..
ls
shell: bash

# Generating static library, note that i386 architecture is deprecated
# Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
- name: Build raylib Library
run: |
cd raylib/src
clang --version
# Extract version numbers from Makefile
brew install grep
RAYLIB_API_VERSION=`ggrep -Po 'RAYLIB_API_VERSION\s*=\s\K(.*)' Makefile`
RAYLIB_VERSION=`ggrep -Po 'RAYLIB_VERSION\s*=\s\K(.*)' Makefile`
# Build raylib x86_64 static
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
mv -v -f libraylib.a libraylib_x86_64.a
make clean
# Build raylib arm64 static
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
mv -v -f libraylib.a libraylib_arm64.a
make clean
# Join x86_64 and arm64 static
lipo -create -output libraylib.a libraylib_x86_64.a libraylib_arm64.a
lipo libraylib.a -detailed_info
Expand All @@ -89,19 +89,19 @@ jobs:
- name: Build Product
run: |
cd ${{ env.PROJECT_NAME }}/src
# 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 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 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
Expand All @@ -124,7 +124,7 @@ jobs:
with:
name: ${{ env.PROJECT_RELEASE_PATH }}.zip
path: ./${{ env.PROJECT_RELEASE_PATH }}.zip

# Alternative: https://github.com/marketplace/actions/gh-release
- name: Upload Artifact to Release
uses: actions/[email protected]
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,43 @@ on:
jobs:
build:
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
PROJECT_SOURCES: sinister.c
BUILD_WEB_SHELL: minshell.html

steps:
- name: Checkout this repo
uses: actions/checkout@master
with:
path: ${{ env.PROJECT_NAME }}

- name: Checkout raylib repo
uses: actions/checkout@v3
with:
repository: raysan5/raylib
path: raylib

- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v12
with:
version: 3.1.30
actions-cache-folder: 'emsdk-cache'

- name: Setup Release Paths
run: |
echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_wasm" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'

- name: Setup Environment
run: |
run: |
mkdir ${{ env.PROJECT_RELEASE_PATH }}
dir
- name: Build raylib Library
run: |
cd raylib/src
Expand All @@ -59,7 +59,7 @@ jobs:
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
- name: Generate Artifacts
run: |
dir ${{ env.PROJECT_BUILD_PATH }}
Expand All @@ -72,14 +72,14 @@ jobs:
dir ${{ env.PROJECT_RELEASE_PATH }}
7z a -tzip -r .\${{ env.PROJECT_RELEASE_PATH }}.zip .\${{ env.PROJECT_RELEASE_PATH }}\*
shell: cmd

# Issue: Double zip: https://github.com/actions/upload-artifact/issues/39
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.PROJECT_RELEASE_PATH }}.zip
path: ./${{ env.PROJECT_RELEASE_PATH }}.zip

# Alternative: https://github.com/marketplace/actions/gh-release
- name: Upload Artifact to Release
uses: actions/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions projects/VS2022/raylib_game/raylib_game.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,12 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\raylib_game.c" />
<ClCompile Include="..\..\..\src\sinister.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\raylib_game.rc" />
<ResourceCompile Include="..\..\..\src\sinister.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

0 comments on commit 2e42b48

Please sign in to comment.