diff options
author | Sean E. Russell <ser@ser1.net> | 2020-06-10 09:24:57 -0500 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-06-10 09:24:57 -0500 |
commit | 28280b79a511bf550422bff717246335de1f53ae (patch) | |
tree | b72d2c20e9865ca556a20c6fcb923af0665cd9d5 | |
parent | 9810b1112f3bbe55cc8aec423c9a4b5d5d9906b1 (diff) |
Add a workflow to auto-build a gotop with this extension.v1.0.1
-rw-r--r-- | .github/workflows/build.yml | 55 | ||||
-rw-r--r-- | README.md | 8 |
2 files changed, 63 insertions, 0 deletions
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 }} @@ -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 |