2
0

release.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: release
  2. on:
  3. push:
  4. # Sequence of patterns matched against refs/tags
  5. tags:
  6. - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
  7. jobs:
  8. build:
  9. name: Build
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Set up Go 1.13
  13. uses: actions/setup-go@v1
  14. with:
  15. go-version: 1.13
  16. id: go
  17. - name: Check out code into the Go module directory
  18. uses: actions/checkout@v2
  19. - name: Get dependencies
  20. run: |
  21. go get -v -t -d ./cmd/tunasync
  22. go get -v -t -d ./cmd/tunasynctl
  23. - name: Build
  24. run: |
  25. make tunasync
  26. make tunasynctl
  27. tar -jcf build/tunasync-linux-bin.tar.bz2 -C build tunasync tunasynctl
  28. - name: Create Release
  29. id: create_release
  30. uses: actions/create-release@v1
  31. env:
  32. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  33. with:
  34. tag_name: ${{ github.ref }}
  35. release_name: Release ${{ github.ref }}
  36. draft: false
  37. prerelease: false
  38. - name: Upload Release Asset
  39. id: upload-release-asset
  40. uses: actions/upload-release-asset@v1
  41. env:
  42. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  43. with:
  44. 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
  45. asset_path: ./build/tunasync-linux-bin.tar.bz2
  46. asset_name: tunasync-linux-bin.tar.bz2
  47. asset_content_type: application/x-bzip2