1515# limitations under the License.
1616
1717# Build and release CLI binaries when cli/* tags are pushed
18- # Uses GoReleaser for cross-platform builds (standard for kubectl plugins)
1918name : CLI Release
2019
2120on :
3433 steps :
3534 - name : Checkout repository
3635 uses : actions/checkout@v4
37- with :
38- fetch-depth : 0
39- fetch-tags : true
4036
4137 - name : Setup Go ${{ env.GO_VERSION }}
4238 uses : actions/setup-go@v5
@@ -47,18 +43,49 @@ jobs:
4743 - name : Extract version from tag
4844 id : version
4945 run : |
50- # Tag is cli/v0.9 .0, extract v0.9 .0
51- VERSION=$(echo "${{ github.ref_name }}" | cut -f 2 -d /)
46+ # Tag is cli/v0.1 .0, extract v0.1 .0
47+ VERSION="${GITHUB_REF_NAME#cli/}"
5248 echo "version=${VERSION}" >> $GITHUB_OUTPUT
5349 echo "Building CLI version: ${VERSION}"
5450
55- - name : Run GoReleaser
56- uses : goreleaser/goreleaser-action@v6
51+ - name : Build CLI binaries
52+ working-directory : operator
53+ run : make cli-release-build CLI_VERSION=${{ steps.version.outputs.version }}
54+
55+ - name : Create GitHub Release
56+ uses : softprops/action-gh-release@v2
5757 with :
58- distribution : goreleaser
59- version : " ~> v2"
60- args : release --clean
61- workdir : operator
62- env :
63- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64- GORELEASER_CURRENT_TAG : ${{ steps.version.outputs.version }}
58+ tag_name : ${{ github.ref_name }}
59+ name : " Skyhook CLI ${{ steps.version.outputs.version }}"
60+ files : |
61+ operator/dist/*.tar.gz
62+ operator/dist/*.zip
63+ operator/dist/checksums.txt
64+ body : |
65+ ## Skyhook CLI ${{ steps.version.outputs.version }}
66+
67+ ### Installation
68+
69+ Download and extract the appropriate archive for your platform.
70+ The binary must be named `kubectl-skyhook` for kubectl to discover it as a plugin.
71+ Alternatively, it can be used directly as `skyhook` without kubectl.
72+
73+ ```bash
74+ # Linux (amd64)
75+ curl -LO https://github.com/NVIDIA/skyhook/releases/download/${{ github.ref_name }}/skyhook_${{ steps.version.outputs.version }}_linux_amd64.tar.gz
76+ tar -xzf skyhook_${{ steps.version.outputs.version }}_linux_amd64.tar.gz
77+ sudo mv skyhook /usr/local/bin/kubectl-skyhook
78+
79+ # macOS (Apple Silicon)
80+ curl -LO https://github.com/NVIDIA/skyhook/releases/download/${{ github.ref_name }}/skyhook_${{ steps.version.outputs.version }}_darwin_arm64.tar.gz
81+ tar -xzf skyhook_${{ steps.version.outputs.version }}_darwin_arm64.tar.gz
82+ sudo mv skyhook /usr/local/bin/kubectl-skyhook
83+ ```
84+
85+ ### Verify installation
86+
87+ ```bash
88+ kubectl skyhook version --client-only
89+ # Or if installed as 'skyhook':
90+ skyhook version --client-only
91+ ```
0 commit comments