mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
feat(ci): use config files from meta repo (#389)
* chore: bump cobra & viper * feat(ci): use config files from meta repo * publish docker images * generate shell completions * generate man pages * feat(ci): use shared workflows from meta repo
This commit is contained in:
parent
5f14914b7e
commit
dec59a2199
7 changed files with 819 additions and 187 deletions
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
|
@ -1,28 +1,12 @@
|
|||
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@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
build:
|
||||
uses: charmbracelet/meta/.github/workflows/build.yml@main
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download Go modules
|
||||
run: go mod download
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
- name: Test
|
||||
run: go test ./...
|
||||
snapshot:
|
||||
uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
|
||||
secrets:
|
||||
goreleaser_key: ${{ secrets.GORELEASER_KEY }}
|
||||
|
|
43
.github/workflows/goreleaser.yml
vendored
43
.github/workflows/goreleaser.yml
vendored
|
@ -1,34 +1,23 @@
|
|||
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@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
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@v3
|
||||
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 }}
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
|||
glow
|
||||
dist/
|
||||
.envrc
|
||||
completions/
|
||||
manpages/
|
110
.goreleaser.yml
110
.goreleaser.yml
|
@ -1,100 +1,12 @@
|
|||
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"
|
||||
includes:
|
||||
- from_url:
|
||||
url: charmbracelet/meta/main/goreleaser-glow.yaml
|
||||
|
||||
archives:
|
||||
-
|
||||
builds:
|
||||
- glow
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
replacements:
|
||||
windows: Windows
|
||||
darwin: Darwin
|
||||
386: i386
|
||||
amd64: x86_64
|
||||
|
||||
nfpms:
|
||||
-
|
||||
vendor: charmbracelet
|
||||
homepage: "https://charm.sh/"
|
||||
maintainer: "Christian Muehlhaeuser <muesli@gmail.com>"
|
||||
description: "Render markdown on the CLI"
|
||||
license: MIT
|
||||
formats:
|
||||
- apk
|
||||
- deb
|
||||
- rpm
|
||||
bindir: /usr/bin
|
||||
|
||||
brews:
|
||||
- goarm: 6
|
||||
tap:
|
||||
owner: charmbracelet
|
||||
name: homebrew-tap
|
||||
commit_author:
|
||||
name: "Christian Muehlhaeuser"
|
||||
email: "muesli@gmail.com"
|
||||
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:
|
||||
main: "."
|
||||
binary_name: glow
|
||||
description: "Render markdown on the CLI, with pizzazz! 💅🏻"
|
||||
github_url: "https://github.com/charmbracelet/soft-serve"
|
||||
maintainer: "Christian Muehlhaeuser <muesli@charm.sh>"
|
||||
brew_commit_author_name: "Christian Muehlhaeuser"
|
||||
brew_commit_author_email: "muesli@charm.sh"
|
||||
|
|
3
Dockerfile
Normal file
3
Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM gcr.io/distroless/static
|
||||
COPY glow /usr/local/bin/glow
|
||||
ENTRYPOINT [ "/usr/local/bin/glow" ]
|
13
go.mod
13
go.mod
|
@ -8,7 +8,6 @@ require (
|
|||
github.com/charmbracelet/charm v0.8.6
|
||||
github.com/charmbracelet/glamour v0.2.1-0.20210402234443-abe9cda419ba
|
||||
github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
|
||||
github.com/google/uuid v1.1.2 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.12
|
||||
github.com/meowgorithm/babyenv v1.3.1
|
||||
|
@ -19,11 +18,9 @@ require (
|
|||
github.com/muesli/termenv v0.8.1
|
||||
github.com/sahilm/fuzzy v0.1.0
|
||||
github.com/segmentio/ksuid v1.0.3
|
||||
github.com/spf13/cobra v1.4.0
|
||||
github.com/spf13/viper v1.4.0
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
|
||||
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc // indirect
|
||||
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78
|
||||
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf
|
||||
golang.org/x/text v0.3.2
|
||||
github.com/spf13/cobra v1.5.0
|
||||
github.com/spf13/viper v1.13.0
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
|
||||
golang.org/x/text v0.3.7
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue