action-main.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. # Triggers the workflow on push tag
  6. push:
  7. tags:
  8. - '*'
  9. # Allows you to run this workflow manually from the Actions tab
  10. workflow_dispatch:
  11. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  12. jobs:
  13. # This workflow contains a single job called "build"
  14. build:
  15. # The type of runner that the job will run on
  16. runs-on: ubuntu-latest
  17. # Steps represent a sequence of tasks that will be executed as part of the job
  18. steps:
  19. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  20. - uses: actions/checkout@v2
  21. # Runs a set of commands using the runners shell
  22. - name: Run startup.sh
  23. run: |
  24. set -e
  25. echo start build
  26. export DOCKER_USERNAME="${{ secrets.DOCKER_USERNAME }}"
  27. export DOCKER_PASSWORD="${{ secrets.DOCKER_PASSWORD }}"
  28. export NUGET_SERVER="${{ secrets.NUGET_SERVER }}"
  29. export NUGET_KEY="${{ secrets.NUGET_KEY }}"
  30. export GIT_SSH_SECRET="${{ secrets.GIT_SSH_SECRET }}"
  31. cd ./Publish/DevOps/github
  32. bash startup.sh
  33. echo build succeed!
  34. - name: Release-Create
  35. id: create_release
  36. uses: actions/create-release@v1
  37. if: hashFiles(env.release_assetPath)
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  40. with:
  41. release_name: ${{ env.release_name }}
  42. tag_name: ${{ env.release_tag }}
  43. draft: ${{ env.Release_draft }}
  44. prerelease: ${{ env.release_prerelease }}
  45. body: ${{ env.release_body }}
  46. - name: Release-Upload
  47. id: upload-release-asset
  48. uses: actions/upload-release-asset@v1
  49. if: hashFiles(env.release_assetPath)
  50. env:
  51. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  52. with:
  53. 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
  54. asset_path: ${{ env.release_assetPath }}
  55. asset_name: ${{ env.release_assetName }}
  56. asset_content_type: ${{ env.release_contentType }}