-
Notifications
You must be signed in to change notification settings - Fork 20
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 #28 from corneliusweig/w/auto-release
- Loading branch information
Showing
2 changed files
with
83 additions
and
7 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 |
---|---|---|
@@ -1,21 +1,64 @@ | ||
name: konfig CI | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
- '*' | ||
tags: | ||
- 'v*.*.*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
- '*' | ||
|
||
name: 'Trigger: Push action' | ||
|
||
jobs: | ||
shellcheck: | ||
name: Shellcheck | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run ShellCheck | ||
|
||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Shellcheck | ||
uses: ludeeus/action-shellcheck@master | ||
env: | ||
SHELLCHECK_OPTS: -e SC2155 | ||
|
||
- name: Run tests | ||
run: | | ||
set -euo pipefail | ||
sudo add-apt-repository ppa:duggan/bats --yes | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq bats | ||
sudo curl -fsSL -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.19.2/bin/linux/amd64/kubectl | ||
sudo chmod +x /usr/bin/kubectl | ||
make test | ||
- name: Create assets | ||
if: contains(github.ref, 'tags') | ||
run: make deploy | ||
|
||
- name: Create release | ||
if: contains(github.ref, 'tags') | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload assets | ||
if: contains(github.ref, 'tags') | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: out/bundle.tar.gz* | ||
overwrite: true | ||
file_glob: true | ||
|
||
- name: Create PR in krew-index | ||
if: contains(github.ref, 'tags') | ||
uses: rajatjindal/[email protected] | ||
with: | ||
krew_template_file: .konfig.yaml |
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,33 @@ | ||
apiVersion: krew.googlecontainertools.github.com/v1alpha2 | ||
kind: Plugin | ||
metadata: | ||
name: konfig | ||
spec: | ||
version: {{ .TagName }} | ||
platforms: | ||
- {{ addURIAndSha "https://github.com/corneliusweig/konfig/releases/download/{{ .TagName }}/bundle.tar.gz" .TagName }} | ||
bin: konfig-krew | ||
files: | ||
- from: ./konfig-krew | ||
to: . | ||
- from: LICENSE | ||
to: . | ||
selector: | ||
matchExpressions: | ||
- key: os | ||
operator: In | ||
values: ["darwin", "linux"] | ||
shortDescription: Merge, split or import kubeconfig files | ||
homepage: https://github.com/corneliusweig/konfig | ||
description: |+2 | ||
konfig helps to merge, split or import kubeconfig files | ||
This is a convenience wrapper around the `kubectl config view` command. | ||
Usage: | ||
$ kubectl konfig import --save new-cfg | ||
$ kubectl konfig merge kubeconfig1 kubeconfig2 > merged | ||
$ kubectl konfig export ctx1 ctx2 -k k8s.yaml,k3s.yaml > extracted | ||
More on https://github.com/corneliusweig/konfig/blob/master/doc/USAGE.md#konfig |