|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [created] |
| 6 | + |
| 7 | +jobs: |
| 8 | + linux: |
| 9 | + name: Linux |
| 10 | + runs-on: ubuntu-18.04 |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checkout server |
| 14 | + uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + repository: callofduty4x/CoD4x_Server |
| 17 | + path: server |
| 18 | + |
| 19 | + - name: Set up needed libs |
| 20 | + run: | |
| 21 | + sudo apt-get install g++-multilib gcc-multilib |
| 22 | + sudo dpkg --add-architecture i386 |
| 23 | + sudo apt-get install nasm:i386 paxctl:i386 libtommath-dev:i386 |
| 24 | + wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz |
| 25 | + sudo tar -zxvf libiconv-1.16.tar.gz |
| 26 | + cd libiconv-1.16 |
| 27 | + sudo ./configure --prefix=/usr/local --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" |
| 28 | + sudo make |
| 29 | + sudo make install |
| 30 | + sudo ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2 |
| 31 | + sudo ldconfig |
| 32 | + |
| 33 | + - name: Checkout plugin |
| 34 | + uses: actions/checkout@v2 |
| 35 | + with: |
| 36 | + repository: leiizko/cod4x_lua_plugin |
| 37 | + path: server/plugins/lua |
| 38 | + |
| 39 | + - name: Build plugin |
| 40 | + run: | |
| 41 | + cd server/plugins/lua |
| 42 | + make ICONV=true |
| 43 | + |
| 44 | + - name: Publish |
| 45 | + uses: ncipollo/release-action@v1 |
| 46 | + with: |
| 47 | + allowUpdates: true |
| 48 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + artifacts: "server/plugins/lua/lua.so" |
| 50 | + |
| 51 | + windows: |
| 52 | + name: Windows |
| 53 | + runs-on: windows-latest |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Get MinGW (i686-8.1.0-release-posix-dwarf) |
| 57 | + run: | |
| 58 | + $Uri = "https://downloads.sourceforge.net/mingw-w64/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z" |
| 59 | + $filename = "mingw32.7z" |
| 60 | + cd C:/ |
| 61 | + Start-BitsTransfer -Source $Uri -Destination $filename |
| 62 | + 7z x $filename |
| 63 | + |
| 64 | + - name: Get NASM |
| 65 | + uses: ilammy/setup-nasm@v1 |
| 66 | + |
| 67 | + - name: Checkout server |
| 68 | + uses: actions/checkout@v2 |
| 69 | + with: |
| 70 | + repository: callofduty4x/CoD4x_Server |
| 71 | + path: server |
| 72 | + |
| 73 | + - name: Get pexports |
| 74 | + run: | |
| 75 | + cd server |
| 76 | + Invoke-WebRequest "https://github.com/callofduty4x/CoD4x_Server/raw/master/tools/pexports-0.47-mingw32-bin.tar.xz" -OutFile "pexports.tar.xz" |
| 77 | + 7z x pexports.tar.xz |
| 78 | + 7z x pexports.tar |
| 79 | + |
| 80 | + - name: Build server |
| 81 | + run: | |
| 82 | + $path = $env:Path |
| 83 | + $env:Path = "C:\mingw32\bin;" |
| 84 | + $env:Path += $path |
| 85 | + cd server |
| 86 | + mingw32-make |
| 87 | + |
| 88 | + - name: Checkout plugin |
| 89 | + uses: actions/checkout@v2 |
| 90 | + with: |
| 91 | + repository: leiizko/cod4x_lua_plugin |
| 92 | + path: server/plugins/lua |
| 93 | + |
| 94 | + - name: Build plugin |
| 95 | + run: | |
| 96 | + $path = $env:Path |
| 97 | + $env:Path = "C:\mingw32\bin;" |
| 98 | + $env:Path += $path |
| 99 | + cd server/plugins/lua |
| 100 | + mingw32-make ICONV=true |
| 101 | + |
| 102 | + - name: Publish |
| 103 | + uses: ncipollo/release-action@v1 |
| 104 | + with: |
| 105 | + allowUpdates: true |
| 106 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 107 | + artifacts: "server/plugins/lua/lua.dll" |
0 commit comments