Skip to content
Draft
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
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
go-version: ['1.19', '1.20', '1.21']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true

- name: Download dependencies
run: go mod download

- name: Verify dependencies
run: go mod verify

- name: Run go vet
run: go vet ./...

- name: Run tests
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21'
uses: codecov/codecov-action@v4
with:
file: ./coverage.out
flags: unittests
name: codecov-umbrella

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --timeout=5m

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true

- name: Build
run: go build -v ./...

- name: Test build with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: build --snapshot --clean
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.19'
cache: true

- name: Run tests
run: go test -v -race ./...

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
node_modules/
dist/
.task/

# Test coverage
coverage.out
coverage.html
106 changes: 97 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# GoReleaser v2 configuration
version: 2

# Before hook - runs before the build
before:
hooks:
- go mod tidy
- go mod download

builds:
- binary: bdcli
- id: bdcli
binary: bdcli
main: ./main.go
env:
- CGO_ENABLED=0
goos:
Expand All @@ -13,22 +23,93 @@ builds:
- arm64
- arm
- '386'
goarm:
- '6'
- '7'
ignore:
- goos: darwin
goarch: '386'
- goos: darwin
goarch: arm
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
mod_timestamp: '{{ .CommitTimestamp }}'

archives:
- format: tar.gz
name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}"
- id: default
format: tar.gz
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format_overrides:
- goos: windows
format: zip
- goos: windows
format: zip
files:
- LICENSE
- README.md

checksum:
name_template: 'bdcli_checksums.txt'
algorithm: sha256

snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
use: github
filters:
exclude:
- '^docs:'
- '^test:'
- '^chore:'
- Merge pull request
- Merge branch
groups:
- title: 'Features'
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: 'Bug Fixes'
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 1
- title: 'Performance Improvements'
regexp: '^.*?perf(\([[:word:]]+\))??!?:.+$'
order: 2
- title: 'Others'
order: 999

release:
draft: true
replace_existing_draft: true
target_commitish: '{{ .Commit }}'
prerelease: auto
mode: replace
header: |
## BetterDiscord CLI {{ .Tag }}

Install with npm: `npm install -g @betterdiscord/cli@{{ .Version }}`
footer: |
**Full Changelog**: https://github.com/BetterDiscord/cli/compare/{{ .PreviousTag }}...{{ .Tag }}

# NPM publishing via go-npm
nfpms:
- id: packages
package_name: betterdiscord-cli
vendor: BetterDiscord
homepage: https://betterdiscord.app/
maintainer: BetterDiscord Team
description: A cross-platform CLI for managing BetterDiscord
license: Apache-2.0
formats:
- deb
- rpm
- apk
bindir: /usr/bin
contents:
- src: LICENSE
dst: /usr/share/doc/betterdiscord-cli/LICENSE

chocolateys:
- name: betterdiscordcli
owners: BetterDiscord
Expand All @@ -37,13 +118,20 @@ chocolateys:
project_url: https://betterdiscord.app/
url_template: "https://github.com/BetterDiscord/cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
icon_url: https://betterdiscord.app/resources/branding/logo_solid.png
copyright: 2023 BetterDiscord Limited
copyright: 2025 BetterDiscord Limited
license_url: https://github.com/BetterDiscord/cli/blob/main/LICENSE
project_source_url: https://github.com/BetterDiscord/cli
docs_url: https://github.com/BetterDiscord/cli/wiki
bug_tracker_url: https://github.com/BetterDiscord/cli/issues
tags: "betterdiscord cli"
tags: "betterdiscord cli discord"
summary: A cross-platform CLI for managing BetterDiscord
description: A cross-platform CLI for managing BetterDiscord
description: |
A cross-platform CLI for managing BetterDiscord.
Provides commands to install, uninstall, and manage BetterDiscord on your system.
release_notes: "https://github.com/BetterDiscord/cli/releases/tag/v{{ .Version }}"
skip_publish: true

# Git configuration
git:
ignore_tags:
- 'nightly'
Loading
Loading