-
-
Notifications
You must be signed in to change notification settings - Fork 28
83 lines (71 loc) · 3.53 KB
/
linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Linux
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
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: "'${{ github.event.repository.name }}.c external/tinyfiledialogs.c'"
PROJECT_CUSTOM_FLAGS: ""
RAYLIB_CONFIG_FLAGS: "'-DSUPPORT_MODULE_RSHAPES -DSUPPORT_MODULE_RTEXTURES -DSUPPORT_MODULE_RTEXT -DSUPPORT_MODULE_RAUDIO -DSUPPORT_EVENTS_WAITING -DSUPPORT_COMPRESSION_API -DSUPPORT_QUADS_DRAW_MODE -DSUPPORT_IMAGE_MANIPULATION -DSUPPORT_DEFAULT_FONT -DSUPPORT_FILEFORMAT_TTF -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 }}_linux_x64" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
- name: Setup Environment
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
gcc --version
make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE RAYLIB_LIBTYPE=STATIC RAYLIB_CONFIG_FLAGS=${{ env.RAYLIB_CONFIG_FLAGS }} RAYLIB_PROJECT_RELEASE_PATH=. -B
- 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
- name: Generate Artifacts
run: |
ls ${{ env.PROJECT_BUILD_PATH }}
cp ${{ env.PROJECT_BUILD_PATH }}/${{ env.PROJECT_NAME }} ${{ 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 }}
7z a ./${{ env.PROJECT_RELEASE_PATH }}.zip ./${{ env.PROJECT_RELEASE_PATH }}
# 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/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ env.PROJECT_RELEASE_PATH }}.zip
asset_path: ./${{ env.PROJECT_RELEASE_PATH }}.zip
asset_content_type: application/zip
if: github.event_name == 'release' && github.event.action == 'published'