-
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.
trying to get windows build, move into src
- Loading branch information
Showing
7 changed files
with
134 additions
and
64 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 |
---|---|---|
|
@@ -19,6 +19,9 @@ jobs: | |
- name: Check out Code | ||
uses: actions/[email protected] | ||
|
||
- name: cd into src | ||
run: cd src | ||
|
||
- name: Build | ||
run: go build -v -ldflags "-X main.Version=${{ inputs.version }}" -o kubectl-browse-pvc . | ||
|
||
|
@@ -44,6 +47,9 @@ jobs: | |
- name: Check out Code | ||
uses: actions/[email protected] | ||
|
||
- name: cd into src | ||
run: cd src | ||
|
||
- name: Build | ||
run: go build -v -ldflags "-X main.Version=${{ inputs.version }}" -o kubectl-browse-pvc . | ||
|
||
|
@@ -69,30 +75,8 @@ jobs: | |
- name: Check out Code | ||
uses: actions/[email protected] | ||
|
||
- name: Build | ||
run: go build -v -ldflags "-X main.Version=${GITHUB_SHA::7}" -o kubectl-browse-pvc . | ||
|
||
- name: Fix permissions | ||
run: chmod +x ./kubectl-browse-pvc | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: kubectl-browse-pvc-linux-x86_64 | ||
path: | | ||
./kubectl-browse-pvc | ||
LICENSE | ||
build-windows-x86_64: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: "1.22.0" | ||
|
||
- name: Check out Code | ||
uses: actions/[email protected] | ||
- name: cd into src | ||
run: cd src | ||
|
||
- name: Build | ||
run: go build -v -ldflags "-X main.Version=${GITHUB_SHA::7}" -o kubectl-browse-pvc . | ||
|
@@ -107,3 +91,28 @@ jobs: | |
path: | | ||
./kubectl-browse-pvc | ||
LICENSE | ||
# build-windows-x86_64: | ||
# runs-on: windows-latest | ||
# steps: | ||
# - name: Set up Go | ||
# uses: actions/[email protected] | ||
# with: | ||
# go-version: "1.22.0" | ||
|
||
# - name: Check out Code | ||
# uses: actions/[email protected] | ||
|
||
# - name: Build | ||
# run: go build -v -ldflags "-X main.Version=${GITHUB_SHA::7}" -o kubectl-browse-pvc . | ||
|
||
# - name: Fix permissions | ||
# run: chmod +x ./kubectl-browse-pvc | ||
|
||
# - name: Upload Artifact | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: kubectl-browse-pvc-linux-x86_64 | ||
# path: | | ||
# ./kubectl-browse-pvc | ||
# LICENSE |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
//go:build linux || darwin | ||
// +build linux darwin | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
|
||
"golang.org/x/term" | ||
"k8s.io/client-go/tools/remotecommand" | ||
) | ||
|
||
type sizeQueue struct { | ||
resizeChan chan remotecommand.TerminalSize | ||
stopResizing chan struct{} | ||
} | ||
|
||
func (s *sizeQueue) Next() *remotecommand.TerminalSize { | ||
size, ok := <-s.resizeChan | ||
if !ok { | ||
return nil | ||
} | ||
return &size | ||
} | ||
|
||
func (s *sizeQueue) Stop() { | ||
close(s.stopResizing) | ||
} | ||
|
||
func (s *sizeQueue) MonitorSize() { | ||
sigCh := make(chan os.Signal, 1) | ||
signal.Notify(sigCh, syscall.SIGWINCH) | ||
|
||
for { | ||
select { | ||
case <-sigCh: | ||
width, height, err := term.GetSize(int(os.Stdout.Fd())) | ||
if err == nil { | ||
select { | ||
case s.resizeChan <- remotecommand.TerminalSize{Width: uint16(width), Height: uint16(height)}: | ||
default: | ||
} | ||
} | ||
case <-s.stopResizing: | ||
close(s.resizeChan) | ||
return | ||
} | ||
} | ||
} |
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,50 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"golang.org/x/term" | ||
"k8s.io/client-go/tools/remotecommand" | ||
) | ||
|
||
type sizeQueue struct { | ||
resizeChan chan remotecommand.TerminalSize | ||
stopResizing chan struct{} | ||
} | ||
|
||
func (s *sizeQueue) Next() *remotecommand.TerminalSize { | ||
size, ok := <-s.resizeChan | ||
if !ok { | ||
return nil | ||
} | ||
return &size | ||
} | ||
|
||
func (s *sizeQueue) Stop() { | ||
close(s.stopResizing) | ||
} | ||
|
||
func (s *sizeQueue) MonitorSize() { | ||
sigCh := make(chan os.Signal, 1) | ||
// Need to fix this to get it working on windows | ||
//signal.Notify(sigCh, syscall.SIGWINCH) | ||
|
||
for { | ||
select { | ||
case <-sigCh: | ||
width, height, err := term.GetSize(int(os.Stdout.Fd())) | ||
if err == nil { | ||
select { | ||
case s.resizeChan <- remotecommand.TerminalSize{Width: uint16(width), Height: uint16(height)}: | ||
default: | ||
} | ||
} | ||
case <-s.stopResizing: | ||
close(s.resizeChan) | ||
return | ||
} | ||
} | ||
} |
File renamed without changes.