-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Azure/jose/krew
ci: Add krew plugin manifest and release job
- Loading branch information
Showing
3 changed files
with
114 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ on: | |
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
|
@@ -60,7 +62,7 @@ jobs: | |
- name: Add kubectl-az-${{ matrix.os }}-${{ matrix.arch }}.tar.gz as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: kubectl-az-${{ matrix.os }}-${{ matrix.arch }} | ||
name: kubectl-az-${{ matrix.os }}-${{ matrix.arch }}-tar-gz | ||
path: kubectl-az-${{ matrix.os }}-${{ matrix.arch }}.tar.gz | ||
|
||
unit-tests: | ||
|
@@ -171,7 +173,7 @@ jobs: | |
- name: Get kubectl-az from artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: kubectl-az-${{ env.os }}-${{ matrix.arch }} | ||
name: kubectl-az-${{ env.os }}-${{ matrix.arch }}-tar-gz | ||
- name: Prepare kubectl-az binary | ||
shell: bash | ||
run: | | ||
|
@@ -195,3 +197,37 @@ jobs: | |
shell: bash | ||
run: | | ||
make integration-test -o kubectl-az | ||
release: | ||
name: Release | ||
needs: [ integration-tests ] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
# Checkout the repo to get the .krew.yaml file | ||
- uses: actions/checkout@v3 | ||
- name: Get all artifacts. | ||
uses: actions/download-artifact@v3 | ||
- name: Rename all artifacts to kubectl-az-${{ github.ref_name }}.tar.gz | ||
shell: bash | ||
run: | | ||
for i in kubectl-az-*-*-tar-gz/kubectl-az-*-*.tar.gz; do | ||
mv $i $(dirname $i)/$(basename $i .tar.gz)-${{ github.ref_name }}.tar.gz | ||
done | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: Release ${{ github.ref }} | ||
- name: Upload kubectl-az binaries to the release | ||
uses: csexton/release-asset-action@v2 | ||
with: | ||
pattern: "kubectl-az-*-*-tar-gz/kubectl-az-*-*.tar.gz" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-url: ${{ steps.create_release.outputs.upload_url }} | ||
- name: Update new version in krew-index | ||
if: github.repository == 'azure/kubectl-az' | ||
uses: rajatjindal/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: krew.googlecontainertools.github.com/v1alpha2 | ||
kind: Plugin | ||
metadata: | ||
name: az | ||
spec: | ||
version: {{ .TagName }} | ||
homepage: https://github.com/Azure/kubectl-az | ||
shortDescription: Interact with an AKS cluster | ||
description: | | ||
This plugin provides a set of commands that can be used to debug an AKS | ||
cluster even when the cluster's control plane is not working correctly. For | ||
instance, when the API server is having problems. | ||
This plugin is not meant to replace az, but to complement it by providing | ||
additional commands and, mainly, allowing users to have a kubectl-like | ||
experience when working with an AKS cluster. | ||
platforms: | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/Azure/kubectl-az/releases/download/{{ .TagName }}/kubectl-az-linux-amd64-{{ .TagName }}.tar.gz" .TagName }} | ||
bin: kubectl-az | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/Azure/kubectl-az/releases/download/{{ .TagName }}/kubectl-az-darwin-amd64-{{ .TagName }}.tar.gz" .TagName }} | ||
bin: kubectl-az | ||
- selector: | ||
matchLabels: | ||
os: windows | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/Azure/kubectl-az/releases/download/{{ .TagName }}/kubectl-az-windows-amd64-{{ .TagName }}.tar.gz" .TagName }} | ||
bin: kubectl-az |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters