ki_devops3_build.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # This is a basic workflow to help you get started with Actions
  2. name: ki_devops3_build
  3. # Controls when the action will run.
  4. on:
  5. #push:
  6. # Triggers the workflow on push events for the branches start with release
  7. #branches:: [ 'release/**' ]
  8. # Triggers the workflow on push events but only for the master branch
  9. #branches: [ master ]
  10. # Triggers the workflow on push tag
  11. #tags: ['*']
  12. # Allows you to run this workflow manually from the Actions tab
  13. workflow_dispatch:
  14. merge_group:
  15. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  16. jobs:
  17. # This workflow contains a single job called "devops3_test"
  18. devops3_test:
  19. # The type of runner that the job will run on
  20. runs-on: ubuntu-latest
  21. # Steps represent a sequence of tasks that will be executed as part of the job
  22. steps:
  23. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  24. - uses: actions/checkout@v4
  25. # Runs a set of commands using the runners shell
  26. - name: Run test
  27. run: |
  28. set -e
  29. echo call ./Publish/DevOps3/build-bash/10.Test.bash to test
  30. cd ./Publish/DevOps3/build-bash
  31. bash 10.Test.bash;
  32. echo run test succeed!
  33. # This workflow contains a single job called "devops3_build"
  34. devops3_build:
  35. # Requiring successful dependent jobs
  36. needs: devops3_test
  37. # The type of runner that the job will run on
  38. runs-on: ubuntu-latest
  39. # Steps represent a sequence of tasks that will be executed as part of the job
  40. steps:
  41. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  42. - uses: actions/checkout@v4
  43. # Runs a set of commands using the runners shell
  44. - name: Run build
  45. run: |
  46. set -e
  47. echo call ./Publish/DevOps3/github-bash/startup.bash to build
  48. export DOCKER_ImagePrefix="serset/"
  49. export DOCKER_USERNAME="${{ secrets.DOCKER_USERNAME }}"
  50. export DOCKER_PASSWORD="${{ secrets.DOCKER_PASSWORD }}"
  51. export NUGET_SERVER="${{ secrets.NUGET_SERVER }}"
  52. export NUGET_KEY="${{ secrets.NUGET_KEY }}"
  53. export WebDav_BaseUrl="${{ secrets.WebDav_BaseUrl }}"
  54. export WebDav_User="${{ secrets.WebDav_User }}"
  55. cd ./Publish/DevOps3/github-bash
  56. bash startup.bash
  57. echo build succeed!
  58. # echo "appName=${APPNAME}" >> $GITHUB_ENV
  59. - name: release_create
  60. id: release_create
  61. uses: actions/create-release@v1
  62. #if: hashFiles(env.release_assetPath)
  63. env:
  64. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  65. with:
  66. release_name: ${{ env.release_name }}
  67. tag_name: ${{ env.release_tag }}
  68. draft: ${{ env.release_draft }}
  69. prerelease: ${{ env.release_prerelease }}
  70. body: ${{ env.release_body }}
  71. # release_upload_asset
  72. - uses: actions/upload-release-asset@v1
  73. env:
  74. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  75. with:
  76. upload_url: ${{ steps.release_create.outputs.upload_url }}
  77. asset_path: ${{ env.release_dirPath }}/${{ env.appName }}-Station(net6.0)-${{ env.release_version }}.zip
  78. asset_name: ${{ env.appName }}-Station-net6.0-${{ env.release_version }}.zip
  79. asset_content_type: application/zip
  80. - uses: actions/upload-release-asset@v1
  81. env:
  82. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  83. with:
  84. upload_url: ${{ steps.release_create.outputs.upload_url }}
  85. asset_path: ${{ env.release_dirPath }}/${{ env.appName }}-docker-image-${{ env.release_version }}.zip
  86. asset_name: ${{ env.appName }}-docker-image-${{ env.release_version }}.zip
  87. asset_content_type: application/zip
  88. - uses: actions/upload-release-asset@v1
  89. env:
  90. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  91. with:
  92. upload_url: ${{ steps.release_create.outputs.upload_url }}
  93. asset_path: ${{ env.release_dirPath }}/${{ env.appName }}-docker-deploy-${{ env.release_version }}.zip
  94. asset_name: ${{ env.appName }}-docker-deploy-${{ env.release_version }}.zip
  95. asset_content_type: application/zip