summary refs log tree commit diff
path: root/.github/workflows/build_rpi.yml
blob: 97e40a2ff7144c4eb918e662a3c1028f19db2f9f (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Build latest (RPI)
# trigger via either push to selected branches or on manual run
on:
  push:
    branches:
      - main
      - master
  workflow_dispatch:

concurrency:
  group: ${{ github.ref }}-rpi
  cancel-in-progress: true

jobs:
#============================================
# ================ 32 BIT RPI ===============
# ===========================================
  build-RPI32:
    runs-on: ubuntu-latest
    container:
      image: dockcross/linux-armv6-lts
    steps:
      - uses: actions/checkout@v4
      - name: Retrieve OpenGL and X11 dev files
        run: |
          mkdir src/rpi
          cd src/rpi
          wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/rpi32.zip
          unzip rpi32.zip
      - name: Compile RPI 32 bit build
        id: compile
        env: 
          COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
          RPI32_FLAGS: "-fvisibility=hidden -rdynamic -DCC_BUILD_ICON -DCC_BUILD_RPI -I rpi/include -L rpi/lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
        run: |
          LATEST_FLAG=-DCC_COMMIT_SHA=\"$GITHUB_SHA\"
          
          cd src
          $CC *.c ${{ env.COMMON_FLAGS }} ${{ env.RPI32_FLAGS }} $LATEST_FLAG -o cc-rpi32 -lGLESv2 -lEGL -lX11 -lXi -lm -lpthread -ldl -lrt


      - uses: ./.github/actions/notify_failure
        if: ${{ always() && steps.compile.outcome == 'failure' }}
        with:
          NOTIFY_MESSAGE: 'Failed to compile RPI 32 bit build'
          WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
          
          
      - uses: ./.github/actions/upload_build
        if: ${{ always() && steps.compile.outcome == 'success' }}
        with:
          SOURCE_FILE: 'src/cc-rpi32'
          DEST_NAME: 'cc-rpi32'
          
          
      - uses: ./.github/actions/notify_success
        if: ${{ always() && steps.compile.outcome == 'success' }}
        with:
          DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
          WORKFLOW_NAME: 'rpi32'


#============================================
# ================ 64 BIT RPI ===============
# ===========================================
  build-RPI64:
    runs-on: ubuntu-latest
    container:
      image: dockcross/linux-arm64-lts
    steps:
      - uses: actions/checkout@v4
      - name: Retrieve OpenGL and X11 dev files
        run: |
          mkdir src/rpi
          cd src/rpi
          wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/rpi64.zip
          unzip rpi64.zip     
      - name: Compile RPI 64 bit build
        id: compile
        env: 
          COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
          RPI64_FLAGS: "-fvisibility=hidden -rdynamic -DCC_BUILD_ICON -DCC_BUILD_RPI -I rpi/include -L rpi/lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
        run: |
          LATEST_FLAG=-DCC_COMMIT_SHA=\"$GITHUB_SHA\"
          
          cd src
          $CC *.c ${{ env.COMMON_FLAGS }} ${{ env.RPI64_FLAGS }} $LATEST_FLAG -o cc-rpi64 -lGLESv2 -lEGL -lX11 -lXi -lm -lpthread -ldl -lrt


      - uses: ./.github/actions/notify_failure
        if: ${{ always() && steps.compile.outcome == 'failure' }}
        with:
          NOTIFY_MESSAGE: 'Failed to compile RPI 64 bit build'
          WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
          
          
      - uses: ./.github/actions/upload_build
        if: ${{ always() && steps.compile.outcome == 'success' }}
        with:
          SOURCE_FILE: 'src/cc-rpi64'
          DEST_NAME: 'cc-rpi64'
          
          
      - uses: ./.github/actions/notify_success
        if: ${{ always() && steps.compile.outcome == 'success' }}
        with:
          DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
          WORKFLOW_NAME: 'rpi64'