action-main.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # This is a basic workflow to help you get started with Actions
  2. name: CI
  3. # Controls when the action will run.
  4. on:
  5. push:
  6. # Triggers the workflow on push events but only for the master branch
  7. #branches: [ master ]
  8. # Triggers the workflow on push tag
  9. tags: ['*']
  10. # Allows you to run this workflow manually from the Actions tab
  11. workflow_dispatch:
  12. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  13. jobs:
  14. # This workflow contains a single job called "build"
  15. build:
  16. # The type of runner that the job will run on
  17. runs-on: ubuntu-latest
  18. # Steps represent a sequence of tasks that will be executed as part of the job
  19. steps:
  20. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  21. - uses: actions/checkout@v2
  22. # Runs a set of commands using the runners shell
  23. - name: Run startup.bash
  24. run: |
  25. set -e
  26. echo start build
  27. export DOCKER_USERNAME="${{ secrets.DOCKER_USERNAME }}"
  28. export DOCKER_PASSWORD="${{ secrets.DOCKER_PASSWORD }}"
  29. export NUGET_SERVER="${{ secrets.NUGET_SERVER }}"
  30. export NUGET_KEY="${{ secrets.NUGET_KEY }}"
  31. export GIT_SSH_SECRET="${{ secrets.GIT_SSH_SECRET }}"
  32. cd ./Publish/DevOps/github
  33. bash startup.bash
  34. echo build succeed!
  35. - name: Release-Create
  36. id: create_release
  37. uses: actions/create-release@v1
  38. if: hashFiles(env.release_assetPath)
  39. env:
  40. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  41. with:
  42. release_name: ${{ env.release_name }}
  43. tag_name: ${{ env.release_tag }}
  44. draft: ${{ env.release_draft }}
  45. prerelease: ${{ env.release_prerelease }}
  46. body: ${{ env.release_body }}
  47. - name: Release-Upload
  48. id: upload-release-asset
  49. uses: actions/upload-release-asset@v1
  50. if: hashFiles(env.release_assetPath)
  51. env:
  52. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  53. with:
  54. upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
  55. asset_path: ${{ env.release_assetPath }}
  56. asset_name: ${{ env.release_assetName }}
  57. asset_content_type: ${{ env.release_contentType }}