tagadd.yml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Release build
  2. on:
  3. push:
  4. branches:
  5. - ci_check
  6. tags:
  7. - 'v0.6*'
  8. jobs:
  9. build-packages:
  10. name: Build 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. cd artifacts
  26. echo "##[set-output name=libpackage;]$(ls -1 libqtprotobuf_*.deb)"
  27. echo "##[set-output name=devpackage;]$(ls -1 libqtprotobuf-dev_*.deb)"
  28. echo "##[set-output name=devrpmpackage;]$(ls -1 libqtprotobuf-*-devel.rpm)"
  29. echo "##[set-output name=librpmpackage;]$(ls -1 libqtprotobuf-*.rpm | grep -v 'devel')"
  30. - name: Create Release
  31. id: create_release
  32. uses: actions/create-release@v1
  33. env:
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. with:
  36. tag_name: ${{ github.ref }}
  37. release_name: Release ${{ github.ref }}
  38. draft: false
  39. prerelease: false
  40. - name: Upload release lib .deb package
  41. id: upload_lib
  42. uses: actions/upload-release-asset@v1
  43. env:
  44. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  45. with:
  46. upload_url: ${{ steps.create_release.outputs.upload_url }}
  47. asset_path: artifacts/${{ steps.build_release.outputs.libpackage }}
  48. asset_name: ${{ steps.build_release.outputs.libpackage }}
  49. asset_content_type: application/x-debian-package
  50. - name: Upload release develop .deb package
  51. id: upload_dev
  52. uses: actions/upload-release-asset@v1
  53. env:
  54. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  55. with:
  56. upload_url: ${{ steps.create_release.outputs.upload_url }}
  57. asset_path: artifacts/${{ steps.build_release.outputs.devpackage }}
  58. asset_name: ${{ steps.build_release.outputs.devpackage }}
  59. asset_content_type: application/x-debian-package
  60. - name: Upload release .rpm package
  61. id: upload_rpm_lib
  62. uses: actions/upload-release-asset@v1
  63. env:
  64. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  65. with:
  66. upload_url: ${{ steps.create_release.outputs.upload_url }}
  67. asset_path: artifacts/${{ steps.build_release.outputs.librpmpackage }}
  68. asset_name: ${{ steps.build_release.outputs.librpmpackage }}
  69. asset_content_type: application/x-rpm
  70. - name: Upload release develop .rpm package
  71. id: upload_rpm_dev
  72. uses: actions/upload-release-asset@v1
  73. env:
  74. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  75. with:
  76. upload_url: ${{ steps.create_release.outputs.upload_url }}
  77. asset_path: artifacts/${{ steps.build_release.outputs.devrpmpackage }}
  78. asset_name: ${{ steps.build_release.outputs.devrpmpackage }}
  79. asset_content_type: application/x-rpm