release.yml 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. name: Release
  2. # Controls when the workflow will run
  3. on:
  4. release:
  5. types: [published]
  6. # Allows you to run this workflow manually from the Actions tab
  7. workflow_dispatch:
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v2
  14. - name: Setup Go
  15. uses: actions/setup-go@v2
  16. with:
  17. go-version: ^1.17.1
  18. - name: Cache go module
  19. uses: actions/cache@v2
  20. with:
  21. path: |
  22. ~/.cache/go-build
  23. ~/go/pkg/mod
  24. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  25. restore-keys: |
  26. ${{ runner.os }}-go-
  27. - name: Build
  28. if: startsWith(github.ref, 'refs/tags/')
  29. env:
  30. NAME: oci-help
  31. BINDIR: build
  32. run: |
  33. make release -j$(nproc)
  34. - name: Upload Release
  35. uses: softprops/action-gh-release@v1
  36. if: startsWith(github.ref, 'refs/tags/')
  37. with:
  38. files: build/*.zip