diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f8d150c..a35e4ac 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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: @@ -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 @@ -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 }}* \ No newline at end of file + # - 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 }}* \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fa4e21..54fbfc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml deleted file mode 100644 index b026716..0000000 --- a/.goreleaser.yaml +++ /dev/null @@ -1,4 +0,0 @@ -builds: - - env: [CGO_ENABLED=0] - goos: [linux, windows, darwin] - goarch: [amd64, arm64] \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..58e2ba4 --- /dev/null +++ b/.goreleaser.yml @@ -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:' \ No newline at end of file diff --git a/cmd/usb.go b/cmd/usb.go index 4e40436..bd5ae92 100644 --- a/cmd/usb.go +++ b/cmd/usb.go @@ -4,6 +4,7 @@ import ( "bufio" "fmt" "os" + "strings" "github.com/spf13/cobra" ) @@ -53,7 +54,7 @@ var formatCmd = &cobra.Command{ reader := bufio.NewReader(os.Stdin) text, _ := reader.ReadString('\n') - if text != "yes\n" { + if strings.ToLower(text) != "yes\n" { fmt.Println("Aborted.") return nil }