tagadd.yml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. name: Release build
  2. on:
  3. push:
  4. branches:
  5. - ci_check
  6. tags:
  7. - 'v0.6*'
  8. jobs:
  9. build-linux-packages:
  10. name: Build Linux release packages
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Init submodules
  15. run: git submodule update --init src/protobuf/3rdparty/microjson
  16. - name: Build release packages on ubuntu and opensuse latest
  17. id: build_release
  18. run: |
  19. mkdir artifacts
  20. docker build . --file .ci/Dockerfile.ubuntu_deb --tag ubuntu_debimage:latest
  21. docker run --mount type=bind,source="$(pwd)"/artifacts,target=/artifacts ubuntu_debimage:latest sh -c "mv /build/*.deb /artifacts"
  22. docker build . --file .ci/Dockerfile.opensuse_rpm --tag opensuse_rpmimage:latest
  23. docker run --mount type=bind,source="$(pwd)"/artifacts,target=/artifacts opensuse_rpmimage:latest sh -c "mv /build/*.rpm /artifacts"
  24. ls artifacts/*
  25. - uses: actions/upload-artifact@master
  26. with:
  27. name: linux-binaries
  28. path: artifacts
  29. build-windows-packages:
  30. name: Build Windows release packages
  31. runs-on: windows-latest
  32. steps:
  33. - uses: actions/checkout@v2
  34. - name: Init submodules
  35. run: git submodule update --init --recursive
  36. - uses: shogo82148/actions-setup-perl@v1
  37. with:
  38. perl-version: '5.30'
  39. distribution: strawberry
  40. - uses: microsoft/setup-msbuild@v1.0.2
  41. with:
  42. vs-version: '16.4'
  43. - name: Install Deps
  44. run: |
  45. choco install wget golang
  46. mkdir C:\yasm
  47. wget -q http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe -O C:\yasm\yasm.exe
  48. - name: Install Qt
  49. run: |
  50. wget -q https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe -O C:/qt-unified-windows-x86-online.exe
  51. C:/qt-unified-windows-x86-online.exe --script ./.ci/qt_installer_windows.qs -d
  52. - name: Build in Windows
  53. id: build_release_windows
  54. run: |
  55. mkdir build-static
  56. mkdir install
  57. cd build-static
  58. setx GOROOT "c:\Go"
  59. setx path "%path%;C:\Qt\5.15.2\msvc2019_64\bin;C:\Go\bin;C:\yasm"
  60. set GOROOT="c:\Go"
  61. set PATH="%PATH%;C:\Qt\5.15.2\msvc2019_64\bin;C:\Go\bin;C:\yasm"
  62. cmake -DCMAKE_PREFIX_PATH="C:\Qt\5.15.2\msvc2019_64;C:\Go\bin;C:\yasm" -DBUILD_SHARED_LIBS=OFF -DQT_PROTOBUF_MAKE_TESTS=OFF -DQT_PROTOBUF_MAKE_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="../install" ..
  63. cmake --build . --config Release --parallel
  64. cpack -G ZIP -C Release -v
  65. mkdir artifacts
  66. copy *.zip artifacts
  67. - uses: actions/upload-artifact@master
  68. with:
  69. name: windows-binaries
  70. path: build-static/artifacts
  71. create-release:
  72. name: Create release and upload packages
  73. runs-on: ubuntu-latest
  74. needs: [build-windows-packages, build-linux-packages]
  75. steps:
  76. - uses: actions/download-artifact@master
  77. with:
  78. name: linux-binaries
  79. path: artifacts
  80. - uses: actions/download-artifact@master
  81. with:
  82. name: windows-binaries
  83. path: artifacts
  84. - id: set-outputs
  85. run: |
  86. cd artifacts
  87. ls .
  88. echo "::set-output name=libpackage::$(ls -1 libqtprotobuf_*.deb)"
  89. echo "::set-output name=devpackage::$(ls -1 libqtprotobuf-dev_*.deb)"
  90. echo "::set-output name=devrpmpackage::$(ls -1 libqtprotobuf-*-devel.rpm)"
  91. echo "::set-output name=librpmpackage::$(ls -1 libqtprotobuf-*.rpm | grep -v 'devel')"
  92. echo "::set-output name=zippackage::$(ls -1 qtprotobuf-*.zip)"
  93. - name: Create Release
  94. id: create_release
  95. uses: actions/create-release@v1
  96. env:
  97. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  98. with:
  99. tag_name: ${{ github.ref }}
  100. release_name: Release ${{ github.ref }}
  101. draft: false
  102. prerelease: false
  103. - name: Upload release lib .deb package
  104. id: upload_lib
  105. uses: actions/upload-release-asset@v1
  106. env:
  107. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  108. with:
  109. upload_url: ${{ steps.create_release.outputs.upload_url }}
  110. asset_path: artifacts/${{ steps.set-outputs.outputs.libpackage }}
  111. asset_name: ${{ steps.set-outputs.outputs.libpackage }}
  112. asset_content_type: application/x-debian-package
  113. - name: Upload release develop .deb package
  114. id: upload_dev
  115. uses: actions/upload-release-asset@v1
  116. env:
  117. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  118. with:
  119. upload_url: ${{ steps.create_release.outputs.upload_url }}
  120. asset_path: artifacts/${{ steps.set-outputs.outputs.devpackage }}
  121. asset_name: ${{ steps.set-outputs.outputs.devpackage }}
  122. asset_content_type: application/x-debian-package
  123. - name: Upload release .rpm package
  124. id: upload_rpm_lib
  125. uses: actions/upload-release-asset@v1
  126. env:
  127. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  128. with:
  129. upload_url: ${{ steps.create_release.outputs.upload_url }}
  130. asset_path: artifacts/${{ steps.set-outputs.outputs.librpmpackage }}
  131. asset_name: ${{ steps.set-outputs.outputs.librpmpackage }}
  132. asset_content_type: application/x-rpm
  133. - name: Upload release develop .rpm package
  134. id: upload_rpm_dev
  135. uses: actions/upload-release-asset@v1
  136. env:
  137. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  138. with:
  139. upload_url: ${{ steps.create_release.outputs.upload_url }}
  140. asset_path: artifacts/${{ steps.set-outputs.outputs.devrpmpackage }}
  141. asset_name: ${{ steps.set-outputs.outputs.devrpmpackage }}
  142. asset_content_type: application/x-rpm
  143. - name: Upload release .zip package
  144. id: upload_zip_dev
  145. uses: actions/upload-release-asset@v1
  146. env:
  147. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  148. with:
  149. upload_url: ${{ steps.create_release.outputs.upload_url }}
  150. asset_path: artifacts/${{ steps.set-outputs.outputs.zippackage }}
  151. asset_name: ${{ steps.set-outputs.outputs.zippackage }}
  152. asset_content_type: application/zip