This repository has been archived by the owner on Aug 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db921cc
commit 21cbd29
Showing
2 changed files
with
94 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 |
---|---|---|
@@ -1,21 +1,98 @@ | ||
# Hello world docker action | ||
# krew-plugin-release | ||
|
||
This action prints "Hello World" or "Hello" + the name of a person to greet to the log. | ||
`krew-plugin-release` is a [github action](https://github.com/features/actions) that opens a PR with upstream [krew-index](https://github.com/kubernetes-sigs/krew-index) on new release of your plugin. | ||
|
||
## Inputs | ||
# Installing | ||
#### create token | ||
- Navigate to [tokens](https://github.com/settings/tokens) | ||
- Click on 'Generate new token' | ||
- Choose a name e.g. `krew-plugin-release-token` | ||
- Select `repo.public_repo` checkbox | ||
- Generate and copy token | ||
#### add secret to plugin repo | ||
- Navigate to your github repo that has plugin code | ||
- Go to Settings | ||
- Click on `Secrets` on left nav bar | ||
- Click on 'Add new secret' | ||
- Give name of the secret to be `KREW_PLUGIN_RELEASE_TOKEN` (Note: this has to exactly same like this) | ||
- Add the token you created above and save the secret | ||
|
||
### `who-to-greet` | ||
#### create a .krew.yaml file in your plugin git repository. | ||
Below is the file created for [modify-secret](https://github.com/rajatjindal/kubectl-modify-secret). Note that this is a template file, and you can templatize your download uri. The action will process template, fetch the `.tar.gz` file from processed uri, calculate sha, writes the processed plugin manifest and then opens PR in the `krew-index` repo with these changes. | ||
|
||
**Required** The name of the person to greet. Default `"World"`. | ||
Look at this [sample PR](https://github.com/rajatjin/krew-index/pulls/3) created using this action. | ||
|
||
## Outputs | ||
```yaml | ||
apiVersion: krew.googlecontainertools.github.com/v1alpha2 | ||
kind: Plugin | ||
metadata: | ||
name: modify-secret | ||
spec: | ||
version: "{{ .TagName }}" | ||
platforms: | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/rajatjindal/kubectl-modify-secret/releases/download/{{ .TagName }}/darwin-amd64-{{ .TagName }}.tar.gz" .TagName }} | ||
files: | ||
- from: "*" | ||
to: "." | ||
bin: kubectl-modify-secret | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/rajatjindal/kubectl-modify-secret/releases/download/{{ .TagName }}/linux-amd64-{{ .TagName }}.tar.gz" .TagName }} | ||
files: | ||
- from: "*" | ||
to: "." | ||
bin: kubectl-modify-secret | ||
shortDescription: modify secret with implicit base64 translations | ||
caveats: | | ||
Usage: | ||
kubectl modify-secret secret-name -n kube-system | ||
Read the documentation at: | ||
https://github.com/rajatjindal/kubectl-modify-secret | ||
description: | | ||
Usage: | ||
kubectl modify-secret secret-name -n kube-system | ||
### `time` | ||
This plugin fetches the given secret manifest from the cluster, decodes | ||
the payload, opens an editor to make changes, and applies the modified | ||
manifest when done. | ||
homepage: https://github.com/rajatjindal/kubectl-modify-secret | ||
``` | ||
The time we greeted you. | ||
#### Add following file to your .github/workflows dir | ||
## Example usage | ||
Add the following file, and change the plugin name to your plugin name. | ||
```yaml | ||
name: main | ||
on: | ||
release: | ||
types: ["published"] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Open PR for new release of Krew Plugin | ||
uses: rajatjindal/[email protected] | ||
with: | ||
plugin-name: 'your-plugin-name' | ||
upstream-krew-index-owner: 'kubernetes-sigs' | ||
env: | ||
KREW_PLUGIN_RELEASE_TOKEN: ${{ secrets.KREW_PLUGIN_RELEASE_TOKEN }} | ||
``` | ||
# Bug Reports | ||
if you find any issue with this action, please report an issue, and we will try to fix it asap. | ||
# Security Issue | ||
if you find any security issue with this action, please email to rajatjindal83 at gmail dot com | ||
uses: actions/hello-world-docker-action@v1 | ||
with: | ||
who-to-greet: 'Mona the Octocat' |
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