Skip to content

Commit 0bcd0d5

Browse files
authored
fix some ci enhancement (#435)
* fix(release): customize goreleaser config file, by adding json schema and fixing configuration version * fix(go): rename invalid comment format * fix(ci): made release workflow work again replace goreleaser --rm-dist flag by --clean increment go version for release pipeline fetch previous tags use by goreleaser give release workflow content write permissions to publish release
1 parent 561793c commit 0bcd0d5

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

.github/workflows/release.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ on:
1919
- 'v*.*.*'
2020
jobs:
2121
goreleaser:
22+
permissions:
23+
contents: write
2224
runs-on: ubuntu-latest
2325
steps:
2426
- name: Checkout
2527
uses: actions/checkout@master
28+
- run: git fetch --tags
2629
- name: Setup Go
2730
uses: actions/setup-go@v2
2831
with:
29-
go-version: '1.20'
32+
go-version: '1.22'
3033
- name: Install Snapcraft
3134
uses: samuelmeuli/action-snapcraft@v1
3235
- name: Setup Snapcraft
@@ -38,7 +41,7 @@ jobs:
3841
uses: goreleaser/goreleaser-action@v2
3942
with:
4043
version: latest
41-
args: release --rm-dist
44+
args: release --clean
4245
env:
4346
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4447
- name: Update new version for plugin 'ctx' in krew-index

.goreleaser.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
13
# Copyright 2021 Google LLC
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +16,8 @@
1416

1517
# This is an example goreleaser.yaml file with some sane defaults.
1618
# Make sure to check the documentation at http://goreleaser.com
19+
20+
version: 2
1721
before:
1822
hooks:
1923
- go mod download

cmd/kubectx/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var (
1111
version = "v0.0.0+unknown" // populated by goreleaser
1212
)
1313

14-
// VersionOps describes printing version string.
14+
// VersionOp describes printing version string.
1515
type VersionOp struct{}
1616

1717
func (_ VersionOp) Run(stdout, _ io.Writer) error {

cmd/kubens/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var (
1111
version = "v0.0.0+unknown" // populated by goreleaser
1212
)
1313

14-
// VersionOps describes printing version string.
14+
// VersionOp describes printing version string.
1515
type VersionOp struct{}
1616

1717
func (_ VersionOp) Run(stdout, _ io.Writer) error {

internal/env/constants.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919
// interactive context selection when fzf is installed.
2020
EnvFZFIgnore = "KUBECTX_IGNORE_FZF"
2121

22-
// EnvForceColor describes the environment variable to disable color usage
22+
// EnvNoColor describes the environment variable to disable color usage
2323
// when printing current context in a list.
2424
EnvNoColor = `NO_COLOR`
2525

0 commit comments

Comments
 (0)