about summary refs log tree commit diff stats
path: root/.github/workflows/manual.yml
blob: c2a4aa575fe837183f7befc9e1e866143674b22c (plain) (blame)
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
### Manual build Box64 with Github Action
name: Custom build Box64

on:
  workflow_dispatch:
    inputs:
      platform:
        description: 'Target platform name'
        required: true
        default: 'GENERIC_ARM'
        type: choice
        options:
        - X64
        - GENERIC_ARM
        - PHYTIUM
        - RK3326
        - RK3399
        - RK3588
        - RPI4ARM64
        - RPI5ARM64
        - SD845
        - SD888
        - ADLINK
        - TEGRAX1
        - ARM64
      build_type:
        description: 'Build type'
        required: true
        default: 'RelWithDebInfo'
        type: choice
        options:
        - RelWithDebInfo
        - Release
        - Debug
        - MinSizeRel
      dynarec:
        description: 'Enable dynarec'
        required: false
        default: 'true'
        type: boolean
      trace:
        description: 'Enable trace'
        required: false
        default: 'false'
        type: boolean

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout Box64 Repository"
        uses: actions/checkout@v4

      - name: "Environment preparation"
        run: |
          sudo apt-get update
          if [[ ${{ github.event.inputs.platform }} != 'X64' && ${{ github.event.inputs.platform }} != 'GENERIC_ARM' ]]; then
            echo "BOX64_PLATFORM_MARCRO=-D${{ github.event.inputs.platform }}=1" >> $GITHUB_ENV
            echo "BOX64_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
            sudo apt-get -y install git gcc-aarch64-linux-gnu cmake make python3
          else
            if [[ ${{ github.event.inputs.platform }} == 'X64' ]]; then
              echo "BOX64_PLATFORM_MARCRO=-DLD80BITS=1 -DNOALIGN=1" >> $GITHUB_ENV
              echo "BOX64_COMPILER=gcc" >> $GITHUB_ENV
              sudo apt-get -y install git cmake make python3
            else
              echo BOX64_PLATFORM_MARCRO="-DARM_DYNAREC=ON" >> $GITHUB_ENV
              echo "BOX64_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
              sudo apt-get -y install git gcc-aarch64-linux-gnu cmake make python3
            fi
          fi

      - name: "Display Build info"
        run: |
          echo "CMake Platform Macro: ${{ env.BOX64_PLATFORM_MARCRO }}"
          echo "CMake C Compiler: ${{ env.BOX64_COMPILER }}"
          echo "Build type: ${{ github.event.inputs.build_type }}"
          echo "Dynarec Enabled: ${{ github.event.inputs.dynarec }}"
          echo "Trace Enabled: ${{ github.event.inputs.trace }}"

      - name: "Build Box64"
        run: |
          mkdir build
          cd build
          cmake .. -DCMAKE_C_COMPILER=${{ env.BOX64_COMPILER }} ${{ env.BOX64_PLATFORM_MARCRO }}\
                   -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }}\
                   -DARM_DYNAREC:BOOL=${{ github.event.inputs.dynarec }}\
                   -DHAVE_TRACE:BOOL=${{ github.event.inputs.trace }}\
                   -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
          make -j$(nproc) VERBOSE=1

      - name: "Upload Artifact"
        uses: actions/upload-artifact@v4
        with:
          name: box64-${{ github.event.inputs.platform }}-${{ github.event.inputs.build_type }}
          path: build/box64