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 }}