From 28280b79a511bf550422bff717246335de1f53ae Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Wed, 10 Jun 2020 09:24:57 -0500 Subject: Add a workflow to auto-build a gotop with this extension. --- .github/workflows/build.yml | 55 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 8 +++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..51e06d0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +name: Build gotop with NVidia extension + +on: + repository_dispatch: + types: [my-release] + +env: + VERSION: ${{ github.event.client_payload.tag }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.14.3 + + - name: Get tag name + shell: bash + run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF##*/})" + id: tag_name + + - name: Get builder + shell: bash + run: curl -O https://raw.githubusercontent.com/xxxserxxx/gotop-builder/master/build.go + + - name: Generate gotop.go + shell: bash + run: go run ./build.go -r ${VERSION} github.com/xxxserxxx/gotop-nvidia + env: + VERSION: ${{ github.event.client_payload.tag }} + + - name: Compile + shell: bash + run: go build -o gotop -ldflags "-extldflags '-static' -X main.Version=${VERSION}+nvidia:${NVIDIA} -X main.BuildDate=$(date +%Y%m%dT%H%M%s)" ./gotop.go + env: + VERSION: ${{ github.event.client_payload.tag }} + NVIDIA: ${{ steps.tag_name.outputs.tag }} + + - name: Compress + shell: bash + run: xz gotop + + - name: Pre-release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "${VERSION}+nvidia:${NVIDIA}" + draft: false + title: "${VERSION} Linux amd64 with NVidia ${NVIDIA} extension" + files: gotop.xz + env: + VERSION: ${{ github.event.client_payload.tag }} + NVIDIA: ${{ steps.tag_name.outputs.tag }} diff --git a/README.md b/README.md index a4e62a4..b0ccc38 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ Provides NVidia GPU data to gotop +## Dependencies + +- [nvidia-smi](https://wiki.archlinux.org/index.php/NVIDIA/Tips_and_tricks#nvidia-smi) + ## Configuration The refresh rate of NVidia data is controlled by the `nvidia-refresh` parameter in the configuration file. This is a Go `time.Duration` format, for example `2s`, `500ms`, `1m`, etc. + +## Alternatives to test + +https://github.com/mindprince/gonvml -- cgit v1.2.3