release.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: Release
  2. on:
  3. push:
  4. tags:
  5. - 'v*'
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. - uses: actions/setup-go@v2
  12. with:
  13. go-version: '^1.14.6'
  14. - name: Get the version
  15. id: get_version
  16. run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
  17. - name: Repo Tools
  18. run: |
  19. sudo apt-get update -y
  20. sudo apt install reprepro createrepo rsync -y
  21. mkdir -p /tmp/protoc
  22. pushd /tmp/protoc
  23. wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip
  24. unzip protoc-3.12.3-linux-x86_64.zip
  25. popd
  26. sudo chmod +x /tmp/protoc/bin/protoc
  27. sudo cp /tmp/protoc/bin/protoc /usr/bin/protoc
  28. sudo cp -r /tmp/protoc/include/* /usr/local/include/
  29. sudo chmod -R 777 /usr/local/include/google
  30. sudo apt-get install autoconf automake libtool curl make g++ unzip -y
  31. go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
  32. go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
  33. go get -u github.com/golang/protobuf/protoc-gen-go
  34. go get github.com/kevinburke/go-bindata/...
  35. go get github.com/goreleaser/nfpm/cmd/nfpm@latest
  36. ls `go env GOPATH`
  37. - name: Dist
  38. run: VERSION=${{ steps.get_version.outputs.VERSION }} make dist
  39. - name: Make DEB Repo
  40. run: |
  41. mkdir -p ./repo/deb/conf
  42. cp ./contrib/deb-repo-config ./repo/deb/conf/distributions
  43. cp ./dist/*.deb ./repo/deb
  44. reprepro -b ./repo/deb/ includedeb ovpm ./repo/deb/*.deb
  45. - name: Make RPM Repo
  46. run: |
  47. mkdir -p ./repo/rpm/
  48. cp ./contrib/yumrepo.repo ./repo/rpm/ovpm.repo
  49. cp ./dist/*.rpm ./repo/rpm
  50. createrepo --database ./repo/rpm
  51. - name: Publish to GithubPages
  52. uses: JamesIves/github-pages-deploy-action@3.5.7
  53. with:
  54. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  55. BRANCH: gh-pages
  56. FOLDER: repo