Compare commits

..

3 Commits

3 changed files with 44 additions and 8 deletions

View File

@@ -24,15 +24,13 @@ jobs:
- make-release - make-release
strategy: strategy:
matrix: matrix:
goos: [linux, freebsd, darwin, windows] goos: [linux, freebsd, windows]
goarch: [amd64, arm64, riscv64] goarch: [amd64, arm64, riscv64]
exclude: exclude:
- goarch: arm64 - goarch: arm64
goos: windows goos: windows
- goarch: riscv64 - goarch: riscv64
goos: windows goos: windows
- goarch: riscv64
goos: darwin
- goarch: arm64 - goarch: arm64
goos: freebsd goos: freebsd
steps: steps:
@@ -42,11 +40,42 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }} goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }} goarch: ${{ matrix.goarch }}
ldflags: -X main.version=${{ github.ref_name }} ldflags: -X main.version=${{ github. ref_name }}
overwrite: true overwrite: true
md5sum: false md5sum: false
sha256sum: false sha256sum: false
compress_assets: false compress_assets: false
build-darwin:
runs-on: macos-latest
needs:
- make-release
strategy:
matrix:
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: Install macFUSE
run: brew install --cask macfuse
- name: Build binary
env:
GOOS: darwin
GOARCH: ${{ matrix.goarch }}
run: |
go build -ldflags "-X main.version=${{ github.ref_name }}" -o nak-${{ github.ref_name }}-darwin-${{ matrix.goarch }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets. GITHUB_TOKEN }}
with:
upload_url: ${{ needs.make-release.outputs.upload_url }}
asset_path: ./nak-${{ github.ref_name }}-darwin-${{ matrix.goarch }}
asset_name: nak-${{ github.ref_name }}-darwin-${{ matrix.goarch }}
asset_content_type: application/octet-stream
smoke-test-linux-amd64: smoke-test-linux-amd64:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:

View File

@@ -155,6 +155,7 @@ example:
os.Exit(3) os.Exit(3)
} }
} }
kr, sec, err := gatherKeyerFromArguments(ctx, c) kr, sec, err := gatherKeyerFromArguments(ctx, c)
if err != nil { if err != nil {
return err return err

View File

@@ -46,8 +46,14 @@ var (
) )
func isPiped() bool { func isPiped() bool {
stat, _ := os.Stdin.Stat() stat, err := os.Stdin.Stat()
return stat.Mode()&os.ModeCharDevice == 0 if err != nil {
panic(err)
}
mode := stat.Mode()
is := mode&os.ModeCharDevice == 0
return is
} }
func getJsonsOrBlank() iter.Seq[string] { func getJsonsOrBlank() iter.Seq[string] {
@@ -76,7 +82,7 @@ func getJsonsOrBlank() iter.Seq[string] {
return true return true
}) })
if !hasStdin && !isPiped() { if !hasStdin {
yield("{}") yield("{}")
} }