tagadd.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Release build
  2. on:
  3. push:
  4. branches:
  5. - ci_check
  6. tags:
  7. - 'v*'
  8. jobs:
  9. build-packages:
  10. name: Build release packages
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Build release packages on ubuntu and opensuse latest
  15. id: build_release
  16. run: |
  17. mkdir artifacts
  18. docker build . --file .ci/Dockerfile.ubuntu_deb --tag ubuntu_debimage:latest
  19. docker run --mount type=bind,source="$(pwd)"/artifacts,target=/artifacts ubuntu_debimage:latest sh -c "mv /build/*.deb /artifacts"
  20. docker build . --file .ci/Dockerfile.opensuse_rpm --tag opensuse_rpmimage:latest
  21. docker run --mount type=bind,source="$(pwd)"/artifacts,target=/artifacts opensuse_rpmimage:latest sh -c "mv /build/*.rpm /artifacts"
  22. ls artifacts/*
  23. cd artifacts
  24. echo "##[set-output name=libpackage;]$(ls -1 libqtprotobuf_*.deb)"
  25. echo "##[set-output name=devpackage;]$(ls -1 libqtprotobuf-dev_*.deb)"
  26. echo "##[set-output name=devrpmpackage;]$(ls -1 libqtprotobuf-*-devel.rpm)"
  27. echo "##[set-output name=librpmpackage;]$(ls -1 libqtprotobuf-*.rpm | grep -v 'devel')"
  28. - name: Create Release
  29. id: create_release
  30. uses: actions/create-release@v1
  31. env:
  32. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  33. with:
  34. tag_name: ${{ github.ref }}
  35. release_name: Release ${{ github.ref }}
  36. draft: false
  37. prerelease: false
  38. - name: Upload release lib .deb package
  39. id: upload_lib
  40. uses: actions/upload-release-asset@v1
  41. env:
  42. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  43. with:
  44. upload_url: ${{ steps.create_release.outputs.upload_url }}
  45. asset_path: artifacts/${{ steps.build_release.outputs.libpackage }}
  46. asset_name: ${{ steps.build_release.outputs.libpackage }}
  47. asset_content_type: application/x-debian-package
  48. - name: Upload release develop .deb package
  49. id: upload_dev
  50. uses: actions/upload-release-asset@v1
  51. env:
  52. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  53. with:
  54. upload_url: ${{ steps.create_release.outputs.upload_url }}
  55. asset_path: artifacts/${{ steps.build_release.outputs.devpackage }}
  56. asset_name: ${{ steps.build_release.outputs.devpackage }}
  57. asset_content_type: application/x-debian-package
  58. - name: Upload release .rpm package
  59. id: upload_rpm_lib
  60. uses: actions/upload-release-asset@v1
  61. env:
  62. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  63. with:
  64. upload_url: ${{ steps.create_release.outputs.upload_url }}
  65. asset_path: artifacts/${{ steps.build_release.outputs.librpmpackage }}
  66. asset_name: ${{ steps.build_release.outputs.librpmpackage }}
  67. asset_content_type: application/x-rpm
  68. - name: Upload release develop .rpm package
  69. id: upload_rpm_dev
  70. uses: actions/upload-release-asset@v1
  71. env:
  72. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  73. with:
  74. upload_url: ${{ steps.create_release.outputs.upload_url }}
  75. asset_path: artifacts/${{ steps.build_release.outputs.devrpmpackage }}
  76. asset_name: ${{ steps.build_release.outputs.devrpmpackage }}
  77. asset_content_type: application/x-rpm