|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | +permissions: |
| 5 | + contents: read |
| 6 | +jobs: |
| 7 | + build-windows: |
| 8 | + name: Build on Windows |
| 9 | + runs-on: windows-latest |
| 10 | + steps: |
| 11 | + - name: Check Out Repository |
| 12 | + uses: actions/checkout@v4 |
| 13 | + - name: Download External Dependencies |
| 14 | + run: | |
| 15 | + set -x |
| 16 | +
|
| 17 | + curl -fsSL -o 'C:\openssl.tar.gz' 'https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz' |
| 18 | + sha256sum -c <<<'cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 *C:\openssl.tar.gz' |
| 19 | + (cd 'C:\'; tar --force-local -xf 'C:\openssl.tar.gz') |
| 20 | +
|
| 21 | + curl -fsSL -o 'C:\p4api_win32.zip' 'https://ftp.perforce.com/perforce/r24.1/bin.ntx86/p4api_vs2022_static_openssl1.1.1.zip' |
| 22 | + mkdir -p 'C:\p4api\win32' |
| 23 | + (cd 'C:\p4api\win32'; unzip -q 'C:\p4api_win32.zip') |
| 24 | +
|
| 25 | + mkdir -p 'PerforceBinaries\Win_x64' |
| 26 | + curl -fsSL -o 'PerforceBinaries\Win_x64\p4d.exe' 'https://ftp.perforce.com/perforce/r24.1/bin.ntx64/p4d.exe' |
| 27 | + curl -fsSL -o 'PerforceBinaries\Win_x64\p4.exe' 'https://ftp.perforce.com/perforce/r24.1/bin.ntx64/p4.exe' |
| 28 | + shell: bash |
| 29 | + - name: Set Up Developer Command Prompt |
| 30 | + uses: ilammy/msvc-dev-cmd@v1 |
| 31 | + with: |
| 32 | + arch: x86 |
| 33 | + - name: Install the Netwide Assembler |
| 34 | + uses: ilammy/setup-nasm@v1 |
| 35 | + - name: Build OpenSSL |
| 36 | + working-directory: C:\openssl-1.1.1w |
| 37 | + run: | |
| 38 | + perl Configure no-shared no-tests VC-WIN32 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 |
| 39 | + nmake |
| 40 | + nmake install_sw |
| 41 | + - name: Build |
| 42 | + run: | |
| 43 | + $env:INCLUDE += ";$(Resolve-Path 'C:\p4api\win32\p4api-*\include\p4\')" |
| 44 | + $env:LIB += ";$(Resolve-Path 'C:\p4api\win32\p4api-*\lib');${env:ProgramFiles(x86)}\OpenSSL\lib" |
| 45 | +
|
| 46 | + msbuild VersionControl.sln /t:Clean /t:P4Plugin /t:TestServer /p:Configuration=Release /p:Platform=Win32 /p:UseEnv=true |
| 47 | + - name: Upload Artifacts |
| 48 | + uses: actions/upload-artifact@v4 |
| 49 | + with: |
| 50 | + name: unity-p4-plugin-ntx86 |
| 51 | + path: Build/Win32/PerforcePlugin.exe |
| 52 | + - name: Test |
| 53 | + run: | |
| 54 | + perl build.pl -test |
| 55 | + build-linux: |
| 56 | + name: Build on Linux |
| 57 | + runs-on: ubuntu-20.04 |
| 58 | + steps: |
| 59 | + - name: Check Out Repository |
| 60 | + uses: actions/checkout@v4 |
| 61 | + - name: Install Dependencies |
| 62 | + run: | |
| 63 | + sudo apt-get update |
| 64 | + sudo apt-get install -y libgtk-3-dev libssl-dev |
| 65 | + - name: Download External Dependencies |
| 66 | + run: | |
| 67 | + set -x |
| 68 | +
|
| 69 | + curl -fsSL -o /tmp/p4api_linux64.tgz 'https://ftp.perforce.com/perforce/r24.1/bin.linux26x86_64/p4api-glibc2.12-openssl1.1.1.tgz' |
| 70 | + tar -C /tmp -xf /tmp/p4api_linux64.tgz |
| 71 | +
|
| 72 | + mkdir -p PerforceBinaries/linux64 |
| 73 | + curl -fsSL -o 'PerforceBinaries/linux64/p4d' 'https://ftp.perforce.com/perforce/r24.1/bin.linux26x86_64/p4d' |
| 74 | + curl -fsSL -o 'PerforceBinaries/linux64/p4' 'https://ftp.perforce.com/perforce/r24.1/bin.linux26x86_64/p4' |
| 75 | + chmod +x PerforceBinaries/linux64/p4d PerforceBinaries/linux64/p4 |
| 76 | + - name: Build |
| 77 | + run: | |
| 78 | + include_dir=(/tmp/p4api-*/include/p4) |
| 79 | + lib_dir=(/tmp/p4api-*/lib) |
| 80 | +
|
| 81 | + export CFLAGS="-O3 -fPIC -fexceptions -fvisibility=hidden -DLINUX -I$include_dir" |
| 82 | + export CXXFLAGS="$CFLAGS" |
| 83 | + export LDLIBS="-L$lib_dir" |
| 84 | +
|
| 85 | + make -f Makefile.gnu PLATFORM=linux64 |
| 86 | + - name: Upload Artifacts |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: unity-p4-plugin-linux26x86_64-glibc2.31 |
| 90 | + path: Build/linux64/PerforcePlugin |
| 91 | + - name: Test |
| 92 | + run: | |
| 93 | + perl build.pl -test |
| 94 | + build-macos: |
| 95 | + name: Build on macOS |
| 96 | + runs-on: macos-latest |
| 97 | + steps: |
| 98 | + - name: Check Out Repository |
| 99 | + uses: actions/checkout@v4 |
| 100 | + - name: Download External Dependencies |
| 101 | + run: | |
| 102 | + set -x |
| 103 | +
|
| 104 | + curl -sSL -o /tmp/openssl.tar.gz 'https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz' |
| 105 | + shasum -a 256 -c <<<'cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 */tmp/openssl.tar.gz' |
| 106 | + tar -C /tmp -xf /tmp/openssl.tar.gz |
| 107 | +
|
| 108 | + curl -sSL -o /tmp/p4api_macos64.tgz 'https://ftp.perforce.com/perforce/r24.1/bin.macosx105x86_64/p4api-openssl1.1.1.tgz' |
| 109 | + tar -C /tmp -xf /tmp/p4api_macos64.tgz |
| 110 | +
|
| 111 | + mkdir -p PerforceBinaries/OSX |
| 112 | + curl -sSL -o 'PerforceBinaries/OSX/p4d' 'https://ftp.perforce.com/perforce/r24.1/bin.macosx12arm64/p4d' |
| 113 | + curl -sSL -o 'PerforceBinaries/OSX/p4' 'https://ftp.perforce.com/perforce/r24.1/bin.macosx12arm64/p4' |
| 114 | + chmod +x PerforceBinaries/OSX/p4d PerforceBinaries/OSX/p4 |
| 115 | + - name: Build OpenSSL |
| 116 | + working-directory: /tmp/openssl-1.1.1w |
| 117 | + run: | |
| 118 | + perl Configure no-shared no-tests darwin64-x86_64-cc -mmacosx-version-min=10.11 --prefix=/usr/local/ssl/[email protected]_64 |
| 119 | + make depend |
| 120 | + sudo make install_sw |
| 121 | + - name: Build |
| 122 | + run: | |
| 123 | + include_dir=(/tmp/p4api-*/include/p4) |
| 124 | + lib_dir=(/tmp/p4api-*/lib) |
| 125 | +
|
| 126 | + export CFLAGS="-I$include_dir" |
| 127 | + export CXXFLAGS="$CFLAGS" |
| 128 | + export LDLIBS="-L$lib_dir -L/usr/local/ssl/[email protected]_64/lib" |
| 129 | +
|
| 130 | + make -f Makefile.osx |
| 131 | + - name: Upload Artifacts |
| 132 | + uses: actions/upload-artifact@v4 |
| 133 | + with: |
| 134 | + name: unity-p4-plugin-macosx1011x86_64 |
| 135 | + path: Build/OSXx64/PerforcePlugin |
| 136 | + - name: Test |
| 137 | + run: | |
| 138 | + perl build.pl -test |
0 commit comments