Skip to content

Commit

Permalink
Merge branch 'master' into feature/disable-wordwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 authored Jul 11, 2024
2 parents f1e1875 + 2d5bd3b commit d8c1b4d
Show file tree
Hide file tree
Showing 49 changed files with 1,831 additions and 2,691 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @meowgorithm @caarlos0
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Setup**
Please complete the following information along with version numbers, if applicable.
- OS [e.g. Ubuntu, macOS]
- Shell [e.g. zsh, fish]
- Terminal Emulator [e.g. kitty, iterm]
- Terminal Multiplexer [e.g. tmux]
- Locale [e.g. en_US.UTF-8, zh_CN.UTF-8, etc.]

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Source Code**
Please include source code if needed to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
Add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Discord
url: https://charm.sh/discord
about: Chat on our Discord.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"
39 changes: 18 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
name: build

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
go-version: [~1.13, ^1]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
GO111MODULE: "on"
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
build:
uses: charmbracelet/meta/.github/workflows/build.yml@main

- name: Checkout code
uses: actions/checkout@v2
snapshot:
uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
secrets:
goreleaser_key: ${{ secrets.GORELEASER_KEY }}

- name: Download Go modules
run: go mod download
govulncheck:
uses: charmbracelet/meta/.github/workflows/govulncheck.yml@main
with:
go-version: stable

- name: Build
run: go build -v ./...
semgrep:
uses: charmbracelet/meta/.github/workflows/semgrep.yml@main

- name: Test
run: go test ./...
ruleguard:
uses: charmbracelet/meta/.github/workflows/ruleguard.yml@main
with:
go-version: stable
20 changes: 8 additions & 12 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@ on: [push, pull_request]

jobs:
coverage:
strategy:
matrix:
go-version: [^1]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2
go-version: stable

- name: Coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -race -covermode atomic -coverprofile=profile.cov ./...
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
go install github.com/mattn/goveralls@latest
goveralls -coverprofile=profile.cov -service=github
45 changes: 18 additions & 27 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: goreleaser

on:
pull_request:
push:
tags:
- v*.*.*

concurrency:
group: goreleaser
cancel-in-progress: true

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ~1.16
- name: Set up Snapcraft
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Login Snapcraft
env:
SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }}
if: env.SNAPCRAFT_LOGIN != null
run: snapcraft login --with <(echo "$SNAPCRAFT_LOGIN")
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --snapshot --skip-publish --skip-sign --rm-dist
uses: charmbracelet/meta/.github/workflows/goreleaser.yml@main
secrets:
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
docker_token: ${{ secrets.DOCKERHUB_TOKEN }}
gh_pat: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
goreleaser_key: ${{ secrets.GORELEASER_KEY }}
fury_token: ${{ secrets.FURY_TOKEN }}
nfpm_gpg_key: ${{ secrets.NFPM_GPG_KEY }}
nfpm_passphrase: ${{ secrets.NFPM_PASSPHRASE }}
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
# Optional: golangci-lint command line arguments.
args: --issues-exit-code=0
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/soft-serve.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
glow
dist/
.envrc
completions/
manpages/
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ linters:
- goconst
- godot
- godox
- gofumpt
- goimports
- goprintffuncname
- gosec
- ifshort
# - ifshort
- misspell
- prealloc
- revive
Expand Down
108 changes: 11 additions & 97 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,14 @@
env:
- GO111MODULE=on
- CGO_ENABLED=0
before:
hooks:
- go mod tidy
builds:
-
binary: glow
ldflags: -s -w -X main.Version=v{{ .Version }} -X main.CommitSHA={{ .Commit }} -X main.CommitDate={{ .CommitDate }}
goos:
- linux
- darwin
- windows
- freebsd
- openbsd
- netbsd
goarch:
- amd64
- arm64
- "386"
- arm
goarm:
- "7"
ignore:
- goos: windows
goarch: arm64
- goos: windows
goarm: "7"
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json

archives:
-
builds:
- glow
format_overrides:
- goos: windows
format: zip
replacements:
windows: Windows
darwin: Darwin
386: i386
amd64: x86_64
version: 2

nfpms:
-
vendor: charmbracelet
homepage: "https://charm.sh/"
maintainer: "Christian Muehlhaeuser <[email protected]>"
description: "Render markdown on the CLI"
license: MIT
formats:
- apk
- deb
- rpm
bindir: /usr/bin
includes:
- from_url:
url: charmbracelet/meta/main/goreleaser-glow.yaml

brews:
- goarm: 6
tap:
owner: charmbracelet
name: homebrew-tap
commit_author:
name: "Christian Muehlhaeuser"
email: "[email protected]"
homepage: "https://charm.sh/"
description: "Render markdown on the CLI"
# skip_upload: true

snapcrafts:
-
name: glow
publish: true
summary: Render markdown on the CLI, with pizzazz!
description: |
Glow is a terminal based markdown reader designed from the ground up to bring out the beauty—and power—of the CLI.
Use it to discover markdown files, read documentation directly on the command line and stash markdown files to your own private collection so you can read them anywhere. Glow will find local markdown files in subdirectories or a local Git repository.
By the way, all data stashed is encrypted end-to-end: only you can decrypt it. More on that below.
grade: stable
confinement: strict
license: MIT
base: core20

apps:
glow:
plugs: ["home", "network"]

signs:
- artifacts: checksum

checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
variables:
description: "Render markdown on the CLI, with pizzazz!"
github_url: "https://github.com/charmbracelet/soft-serve"
maintainer: "Christian Muehlhaeuser <[email protected]>"
brew_commit_author_name: "Christian Muehlhaeuser"
brew_commit_author_email: "[email protected]"
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM gcr.io/distroless/static
COPY glow /usr/local/bin/glow
ENTRYPOINT [ "/usr/local/bin/glow" ]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2021 Charmbracelet, Inc
Copyright (c) 2019-2023 Charmbracelet, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit d8c1b4d

Please sign in to comment.