mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-06-26 15:31:34 +00:00
Add goreleaser and github workflows
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
5348d7aa7e
commit
0491ac552e
19
.github/workflows/ci.yml
vendored
Normal file
19
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: Go implementation (CI)
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.14
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
with:
|
||||
version: latest
|
||||
args: release --snapshot --skip-publish --rm-dist
|
28
.github/workflows/release.yml
vendored
28
.github/workflows/release.yml
vendored
@ -1,29 +1,23 @@
|
||||
name: release
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
jobs:
|
||||
release:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.14
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
- name: Update new version for plugin 'ctx' in krew-index
|
||||
uses: rajatjindal/krew-release-bot@v0.0.37
|
||||
with:
|
||||
krew_template_file: .krew/ctx.yaml
|
||||
- name: Update new version for plugin 'ns' in krew-index
|
||||
uses: rajatjindal/krew-release-bot@v0.0.37
|
||||
with:
|
||||
krew_template_file: .krew/ns.yaml
|
||||
|
||||
|
||||
|
64
.goreleaser.yml
Normal file
64
.goreleaser.yml
Normal file
@ -0,0 +1,64 @@
|
||||
# This is an example goreleaser.yaml file with some sane defaults.
|
||||
# Make sure to check the documentation at http://goreleaser.com
|
||||
before:
|
||||
hooks:
|
||||
- go mod download
|
||||
builds:
|
||||
- id: kubectx
|
||||
main: ./cmd/kubectx
|
||||
binary: kubectx
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
- id: kubens
|
||||
main: ./cmd/kubens
|
||||
binary: kubens
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
archives:
|
||||
- id: kubectx-archive
|
||||
name_template: "kubectx_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
||||
builds:
|
||||
- kubectx
|
||||
replacements:
|
||||
386: i386
|
||||
amd64: x86_64
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
files: ["LICENSE"]
|
||||
- id: kubens-archive
|
||||
name_template: "kubens_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
||||
builds:
|
||||
- kubens
|
||||
replacements:
|
||||
386: i386
|
||||
amd64: x86_64
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
files: ["LICENSE"]
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- '^docs:'
|
||||
- '^test:'
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
algorithm: sha256
|
||||
release:
|
||||
extra_files:
|
||||
- glob: ./kubens
|
||||
- glob: ./kubectx
|
Loading…
Reference in New Issue
Block a user