go.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Build Jrebel Server
  2. on:
  3. push:
  4. branches:
  5. - master
  6. tags:
  7. - '*'
  8. jobs:
  9. build-job:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v2
  13. - name: Set up Go
  14. uses: actions/setup-go@v2
  15. with:
  16. go-version: 1.16
  17. - name: Config Linux amd64
  18. run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64
  19. - name: Build Linux amd64
  20. run: go build -o build-bin/jrebel-license-active-server-linux_amd64 ./
  21. - name: Config MacOS amd64
  22. run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64
  23. - name: Build MacOS amd64
  24. run: go build -o build-bin/jrebel-license-active-server-darwin_amd64 ./
  25. - name: Config Windows amd64
  26. run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64
  27. - name: Build Windows amd64
  28. run: go build -o build-bin/jrebel-license-active-server-windows_amd64.exe ./
  29. - name: Upload Bin
  30. uses: actions/upload-artifact@v2
  31. if: startsWith(github.ref, 'refs/tags/')
  32. with:
  33. name: exec file
  34. path: |
  35. build-bin/jrebel-license-active-server-linux_amd64
  36. build-bin/jrebel-license-active-server-darwin_amd64
  37. build-bin/jrebel-license-active-server-windows_amd64.exe
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  40. - name: Release
  41. uses: softprops/action-gh-release@v1
  42. if: startsWith(github.ref, 'refs/tags/')
  43. with:
  44. files: |
  45. build-bin/jrebel-license-active-server-linux_amd64
  46. build-bin/jrebel-license-active-server-darwin_amd64
  47. build-bin/jrebel-license-active-server-windows_amd64.exe
  48. env:
  49. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}