release.yml 963 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Release
  2. on:
  3. pull_request:
  4. push:
  5. branches: ['master']
  6. tags: ['v*']
  7. schedule:
  8. - cron: '00 01 * * *'
  9. jobs:
  10. release:
  11. name: release
  12. runs-on: windows-latest
  13. steps:
  14. - uses: actions/checkout@v2
  15. with:
  16. submodules: true
  17. - uses: actions/setup-dotnet@v1
  18. with:
  19. dotnet-version: '5.0.x'
  20. - run: dotnet publish -c Release .\OhmGraphite\
  21. - name: Set artifact name
  22. shell: bash
  23. working-directory: OhmGraphite\bin
  24. run: |
  25. echo "ARTIFACT_NAME=$(echo *.zip)" >> $GITHUB_ENV
  26. - uses: actions/upload-artifact@v2
  27. with:
  28. path: OhmGraphite\bin\*.zip
  29. name: ${{ env.ARTIFACT_NAME }}
  30. if-no-files-found: error
  31. - name: Release
  32. uses: softprops/action-gh-release@v1
  33. if: startsWith(github.ref, 'refs/tags/')
  34. with:
  35. files: 'OhmGraphite\bin\*.zip'
  36. prerelease: true
  37. env:
  38. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}