Skip to content

Commit

Permalink
Merge pull request #28 from corneliusweig/w/auto-release
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusweig authored Nov 7, 2020
2 parents 34985cf + 1f8d02e commit b20399f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 7 deletions.
57 changes: 50 additions & 7 deletions .github/workflows/ci.yml
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
33 changes: 33 additions & 0 deletions .konfig.yaml
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

0 comments on commit b20399f

Please sign in to comment.