Skip to content

Build

Build #8

Workflow file for this run

name: Build
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goos:
- darwin
- windows
- linux
goarch:
- amd64
- arm64
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.23"
- name: Build
run: go build -o kubectl-cs cmd/kubectl-cs.go
- name: Package file
run: |
set +e
rm kubectl-cs.tar.gz &>/dev/null
set -e
tar czf kubectl-cs.tar.gz kubectl-cs LICENSE
- name: Release
uses: djnicholson/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-name: ${{ github.event.release.name }}
tag-name: ${{ github.event.release.tag_name }}
asset-name: kubectl-cs-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
file: kubectl-cs.tar.gz
update-krew:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Update new version in krew-index
uses: rajatjindal/[email protected]