Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 38 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
name: Go

on: [push]
on:
push:
branches:
- main
tags-ignore:
- '**'
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Golangci-lint
uses: golangci/golangci-lint-action@v9
continue-on-error: true
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Install dependencies
run: |
go get .

- name: Test with the Go CLI
run: go test
build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -25,9 +57,6 @@ jobs:
run: |
go get .

- name: Test with the Go CLI
run: go test

- name: Set Short SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
Expand All @@ -37,8 +66,8 @@ jobs:
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o rioctl-${{ steps.vars.outputs.sha_short }}-${{ matrix.os }}-${{ matrix.arch }} .

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: rioctl-${{ steps.vars.outputs.sha_short }}-${{ matrix.os }}-${{ matrix.arch }}
path: rioctl-${{ steps.vars.outputs.sha_short }}-${{ matrix.os }}-${{ matrix.arch }}*
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: rioctl-${{ steps.vars.outputs.sha_short }}-${{ matrix.os }}-${{ matrix.arch }}
# path: rioctl-${{ steps.vars.outputs.sha_short }}-${{ matrix.os }}-${{ matrix.arch }}*
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: "~> v2"
version: "latest"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 0 additions & 4 deletions .goreleaser.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 2

project_name: rioctl

before:
hooks:
- go mod tidy

builds:
- id: rioctl
binary: rioctl
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64

archives:
- id: default
builds:
- rioctl
format_overrides:
- goos: windows
formats: ["zip"]

checksum:
name_template: 'checksums.txt'

# release:
# github:
# owner: your-org
# name: your-repo

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
3 changes: 2 additions & 1 deletion cmd/usb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"bufio"
"fmt"
"os"
"strings"

"github.com/spf13/cobra"
)
Expand All @@ -21,7 +22,7 @@
if err != nil {
return err
}
defer client.Close()

Check failure on line 25 in cmd/usb.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `client.Close` is not checked (errcheck)

out, err := client.Run("lsblk")
if err != nil {
Expand All @@ -41,7 +42,7 @@
if err != nil {
return err
}
defer client.Close()

Check failure on line 45 in cmd/usb.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `client.Close` is not checked (errcheck)

device, _ := cmd.Flags().GetString("device")
if device == "" {
Expand All @@ -53,7 +54,7 @@
reader := bufio.NewReader(os.Stdin)
text, _ := reader.ReadString('\n')

if text != "yes\n" {
if strings.ToLower(text) != "yes\n" {
fmt.Println("Aborted.")
return nil
}
Expand Down
Loading