tagadd.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. cd build-static
  57. setx GOROOT "c:\Go"
  58. setx path "%path%;C:\Qt\5.15.2\msvc2019_64\bin;C:\Go\bin;C:\yasm"
  59. set GOROOT="c:\Go"
  60. set PATH="%PATH%;C:\Qt\5.15.2\msvc2019_64\bin;C:\Go\bin;C:\yasm"
  61. 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 ..
  62. cmake --build . --config Release --parallel
  63. cpack -G ZIP -C Release -v
  64. mkdir artifacts
  65. copy *.zip artifacts
  66. - uses: actions/upload-artifact@master
  67. with:
  68. name: windows-binaries
  69. path: build-static/artifacts
  70. create-release:
  71. name: Create release and upload packages
  72. runs-on: ubuntu-latest
  73. needs: [build-windows-packages, build-linux-packages]
  74. steps:
  75. - uses: actions/download-artifact@master
  76. with:
  77. name: linux-binaries
  78. path: artifacts
  79. - uses: actions/download-artifact@master
  80. with:
  81. name: windows-binaries
  82. path: artifacts
  83. - id: set-outputs
  84. run: |
  85. cd artifacts
  86. ls .
  87. echo "::set-output name=libpackage::$(ls -1 libqtprotobuf_*.deb)"
  88. echo "::set-output name=devpackage::$(ls -1 libqtprotobuf-dev_*.deb)"
  89. echo "::set-output name=devrpmpackage::$(ls -1 libqtprotobuf-*-devel.rpm)"
  90. echo "::set-output name=librpmpackage::$(ls -1 libqtprotobuf-*.rpm | grep -v 'devel')"
  91. echo "::set-output name=zippackage::$(ls -1 qtprotobuf-*.zip)"
  92. - name: Create Release
  93. id: create_release
  94. uses: actions/create-release@v1
  95. env:
  96. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  97. with:
  98. tag_name: ${{ github.ref }}
  99. release_name: Release ${{ github.ref }}
  100. draft: false
  101. prerelease: false
  102. - name: Upload release lib .deb package
  103. id: upload_lib
  104. uses: actions/upload-release-asset@v1
  105. env:
  106. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  107. with:
  108. upload_url: ${{ steps.create_release.outputs.upload_url }}
  109. asset_path: artifacts/${{ steps.set-outputs.outputs.libpackage }}
  110. asset_name: ${{ steps.set-outputs.outputs.libpackage }}
  111. asset_content_type: application/x-debian-package
  112. - name: Upload release develop .deb package
  113. id: upload_dev
  114. uses: actions/upload-release-asset@v1
  115. env:
  116. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  117. with:
  118. upload_url: ${{ steps.create_release.outputs.upload_url }}
  119. asset_path: artifacts/${{ steps.set-outputs.outputs.devpackage }}
  120. asset_name: ${{ steps.set-outputs.outputs.devpackage }}
  121. asset_content_type: application/x-debian-package
  122. - name: Upload release .rpm package
  123. id: upload_rpm_lib
  124. uses: actions/upload-release-asset@v1
  125. env:
  126. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  127. with:
  128. upload_url: ${{ steps.create_release.outputs.upload_url }}
  129. asset_path: artifacts/${{ steps.set-outputs.outputs.librpmpackage }}
  130. asset_name: ${{ steps.set-outputs.outputs.librpmpackage }}
  131. asset_content_type: application/x-rpm
  132. - name: Upload release develop .rpm package
  133. id: upload_rpm_dev
  134. uses: actions/upload-release-asset@v1
  135. env:
  136. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  137. with:
  138. upload_url: ${{ steps.create_release.outputs.upload_url }}
  139. asset_path: artifacts/${{ steps.set-outputs.outputs.devrpmpackage }}
  140. asset_name: ${{ steps.set-outputs.outputs.devrpmpackage }}
  141. asset_content_type: application/x-rpm
  142. - name: Upload release .zip package
  143. id: upload_zip_dev
  144. uses: actions/upload-release-asset@v1
  145. env:
  146. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  147. with:
  148. upload_url: ${{ steps.create_release.outputs.upload_url }}
  149. asset_path: artifacts/${{ steps.set-outputs.outputs.zippackage }}
  150. asset_name: ${{ steps.set-outputs.outputs.zippackage }}
  151. asset_content_type: application/zip