main.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. name: CI
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. runs-on: ${{ matrix.os }}
  6. strategy:
  7. fail-fast: false
  8. matrix:
  9. os: [macOS-latest, windows-2016, ubuntu-20.04]
  10. platform: [x64, x86]
  11. exclude:
  12. - os: macOS-latest
  13. platform: x86
  14. - os: ubuntu-20.04
  15. platform: x86
  16. steps:
  17. - uses: actions/checkout@v1
  18. with:
  19. fetch-depth: 10
  20. - name: Prepare (Linux)
  21. if: matrix.os == 'ubuntu-20.04'
  22. run: |
  23. sudo apt-get install libtool-bin libtomcrypt1 libtomcrypt-dev libtommath1 libtommath-dev libicu-dev zlib1g-dev
  24. - name: Build (Linux)
  25. if: matrix.os == 'ubuntu-20.04'
  26. run: |
  27. CC=clang CXX=clang++ ./autogen.sh --enable-binreloc --prefix=/opt/firebird
  28. make -j4
  29. make dist
  30. tar xzvf gen/Firebird-[0-9]*.tar.gz
  31. (cd Firebird-[0-9]*; sudo ./install.sh -silent)
  32. - name: Prepare (MacOS)
  33. if: matrix.os == 'macOS-latest'
  34. run: |
  35. brew install automake libtool
  36. export LIBTOOLIZE=glibtoolize
  37. export LIBTOOL=glibtool
  38. mkdir extern/icu-macos
  39. pushd extern/icu-macos
  40. curl -OL https://github.com/unicode-org/icu/releases/download/release-63-2/icu4c-63_2-src.tgz
  41. curl -OL https://github.com/unicode-org/icu/commit/24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
  42. tar xzf icu4c-63_2-src.tgz
  43. ICU_INSTALL_PATH=`pwd`/install
  44. cd icu/source
  45. patch -p3 < ../../24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
  46. ./runConfigureICU MacOSX --prefix=$ICU_INSTALL_PATH
  47. make -j4
  48. make install
  49. install_name_tool -id @rpath/lib/libicuuc.dylib $ICU_INSTALL_PATH/lib/libicuuc.dylib
  50. install_name_tool -id @rpath/lib/libicui18n.dylib $ICU_INSTALL_PATH/lib/libicui18n.dylib
  51. install_name_tool -id @rpath/lib/libicudata.dylib $ICU_INSTALL_PATH/lib/libicudata.dylib
  52. install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicuuc.63.dylib
  53. install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib
  54. install_name_tool -change libicuuc.63.dylib @loader_path/libicuuc.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib
  55. popd
  56. mkdir -p gen/Release/firebird/lib
  57. mkdir -p gen/Debug/firebird/lib
  58. cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Release/firebird/lib/
  59. cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Debug/firebird/lib/
  60. - name: Build (MacOS)
  61. if: matrix.os == 'macOS-latest'
  62. run: |
  63. export LIBTOOLIZE=glibtoolize
  64. export LIBTOOL=glibtool
  65. ICU_INSTALL_PATH=`pwd`/extern/icu-macos/install
  66. export C_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$C_INCLUDE_PATH"
  67. export CPLUS_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$CPLUS_INCLUDE_PATH"
  68. LIBRARY_PATH="$ICU_INSTALL_PATH/lib:$LIBRARY_PATH" ./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt
  69. make -j4
  70. (cd gen; make -B -f make.platform.postfix ICU_LOC="$ICU_INSTALL_PATH/lib/")
  71. (cd gen; make -B -f Makefile.install)
  72. # Rename directory to make sure the build is relocatable.
  73. mv gen gen2
  74. sudo installer -pkg gen2/Release/*.pkg -verbose -target /
  75. export FIREBIRD_LOCK=`pwd`/temp
  76. echo "create database 't.fdb'; select '1' from rdb\$database; select _win1252 '2' from rdb\$database; select _utf8 '3' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql
  77. echo "create database 'localhost:/tmp/t.fdb' user sysdba password 'masterkey'; select '11' from rdb\$database; select _win1252 '22' from rdb\$database; select _utf8 '33' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql
  78. mv gen2 gen
  79. mkdir gen/artifacts
  80. mv gen/Release/*.pkg gen/artifacts
  81. - name: Prepare (Windows)
  82. if: matrix.os == 'windows-2016'
  83. shell: cmd
  84. run: |
  85. for /r %%i in (*.bat) do unix2dos "%%i"
  86. - name: Build (Windows)
  87. if: matrix.os == 'windows-2016'
  88. shell: cmd
  89. env:
  90. PLATFORM: ${{ matrix.platform }}
  91. run: |
  92. if "%PLATFORM%" == "x64" set FB_VS_ARCH=amd64
  93. if "%PLATFORM%" == "x64" set FB_PROCESSOR_ARCHITECTURE=AMD64
  94. if "%PLATFORM%" == "x64" set FB_OUTPUT_SUFFIX=x64
  95. if "%PLATFORM%" == "x86" set FB_VS_ARCH=x86
  96. if "%PLATFORM%" == "x86" set FB_PROCESSOR_ARCHITECTURE=x86
  97. if "%PLATFORM%" == "x86" set FB_OUTPUT_SUFFIX=win32
  98. call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=%FB_VS_ARCH%
  99. cd builds\win32
  100. run_all.bat JUSTBUILD
  101. - name: Upload (Linux)
  102. if: matrix.os == 'ubuntu-20.04'
  103. uses: actions/upload-artifact@main
  104. with:
  105. name: firebird-linux-${{ matrix.platform }}
  106. path: gen/Firebird-[0-9]*.tar.gz
  107. - name: Upload (MacOS)
  108. if: matrix.os == 'macOS-latest'
  109. uses: actions/upload-artifact@main
  110. with:
  111. name: firebird-macos
  112. path: gen/artifacts
  113. - name: Upload (Windows x64)
  114. if: matrix.os == 'windows-2016' && matrix.platform == 'x64'
  115. uses: actions/upload-artifact@main
  116. with:
  117. name: firebird-windows-x64
  118. path: output_x64
  119. - name: Upload (Windows x86)
  120. if: matrix.os == 'windows-2016' && matrix.platform == 'x86'
  121. uses: actions/upload-artifact@main
  122. with:
  123. name: firebird-windows-x86
  124. path: output_win32