-
Notifications
You must be signed in to change notification settings - Fork 4
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
bbe0f55
commit 86bbe29
Showing
12 changed files
with
1,008 additions
and
207 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 |
---|---|---|
|
@@ -3,7 +3,6 @@ name: CI | |
on: | ||
push: | ||
branches: [master] | ||
tags: ["v*"] | ||
paths-ignore: ['**.md'] | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
@@ -16,7 +15,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "~1.13.10" | ||
go-version: 1.15.x | ||
- name: Ensure go.mod is already tidied | ||
run: go mod tidy && git diff -s --exit-code go.sum | ||
- uses: actions/cache@v2 | ||
|
@@ -25,51 +24,5 @@ jobs: | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: go get github.com/mitchellh/gox | ||
- run: make test archives test-archive | ||
- name: Create a new release | ||
if: contains(github.ref, 'tags') | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload binaries to the new release | ||
if: contains(github.ref, 'tags') | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: out/* | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true | ||
create-pr: | ||
needs: [run] | ||
if: contains(github.ref, 'tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: kubernetes-sigs/krew-index | ||
- run: | | ||
git fetch --unshallow | ||
git remote set-url origin https://${{ secrets.GH_PAT }}:[email protected]/superbrothers/krew-index.git | ||
- run: echo ::set-env name=GIT_TAG::${GITHUB_REF##*/} | ||
- name: Download the released krew plugin manifest file | ||
run: | | ||
curl -sLo plugins/sort-manifests.yaml https://github.com/superbrothers/kubectl-sort-manifests-plugin/releases/download/${{ env.GIT_TAG }}/sort-manifests.yaml | ||
git --no-pager diff | ||
- uses: peter-evans/create-pull-request@v2 | ||
with: | ||
token: ${{ secrets.GH_PAT }} | ||
committer: Kazuki Suda <[email protected]> | ||
author: Kazuki Suda <[email protected]> | ||
commit-message: Bump the version of sort-manifests to ${{ env.GIT_TAG }} | ||
title: Bump the version of sort-manifests to ${{ env.GIT_TAG }} | ||
body: This PR bumps up the version of sort-manifests to ${{ env.GIT_TAG }}. | ||
branch: sort-manifests-${{ env.GIT_TAG }} | ||
request-to-parent: true | ||
- run: make test | ||
- run: make dist |
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,26 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: ["v*"] | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15.x | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Release | ||
run: make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Update new version in krew-index | ||
uses: rajatjindal/[email protected] |
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 +1,2 @@ | ||
/out | ||
/dist | ||
/hack/tools/bin |
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,27 @@ | ||
env: | ||
- GO111MODULE=on | ||
- GOPROXY=https://gocenter.io | ||
builds: | ||
- main: ./cmd/ksort/main.go | ||
binary: ksort | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm | ||
- arm64 | ||
archives: | ||
- name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}" | ||
format: zip | ||
files: | ||
- LICENSE.txt | ||
- README.md | ||
wrap_in_directory: false | ||
checksum: | ||
name_template: 'checksums.txt' | ||
changelog: | ||
sort: asc |
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
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,23 +1,42 @@ | ||
GO ?= GO111MODULE=on GOPROXY=https://gocenter.io go | ||
DIST_DIR := dist | ||
|
||
.PHONY: build | ||
build: | ||
@OSARCH="$(shell uname -s | tr "[:upper:]" "[:lower:]")/amd64" hack/make-binaries.sh | ||
$(GO) build -o $(DIST_DIR)/ksort cmd/ksort/main.go | ||
|
||
TOOLS_DIR := hack/tools | ||
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin | ||
GORELEASER_BIN := bin/goreleaser | ||
GORELEASER := $(TOOLS_DIR)/$(GORELEASER_BIN) | ||
|
||
$(GORELEASER): $(TOOLS_DIR)/go.mod | ||
cd $(TOOLS_DIR) && $(GO) build -o $(GORELEASER_BIN) github.com/goreleaser/goreleaser | ||
|
||
.PHONY: build-cross | ||
build-cross: | ||
@hack/make-binaries.sh | ||
build-cross: $(GORELEASER) | ||
$(GORELEASER) build --snapshot --rm-dist | ||
|
||
.PHONY: archives | ||
archives: | ||
@hack/make-all.sh | ||
.PHONY: vet | ||
vet: | ||
$(GO) vet ./... | ||
|
||
.PHONY: fmt | ||
fmt: | ||
$(GO) fmt ./... | ||
|
||
.PHONY: test | ||
test: | ||
go test -v ./... | ||
test: vet fmt | ||
$(GO) test -v ./... | ||
|
||
.PHONY: dist | ||
dist: $(GORELEASER) | ||
$(GORELEASER) release --rm-dist --skip-publish --snapshot | ||
|
||
.PHONY: test-archive | ||
test-archive: | ||
@hack/test-archive.sh | ||
.PHONY: release | ||
release: $(GORELEASER) | ||
$(GORELEASER) release --rm-dist | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf out | ||
rm -rf $(DIST_DIR) $(TOOLS_BIN_DIR) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
module github.com/superbrothers/kubectl-open-svc-plugin/hack/tools | ||
|
||
go 1.15 | ||
|
||
require ( | ||
github.com/goreleaser/goreleaser v0.145.0 | ||
) |
Oops, something went wrong.