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
|
name: build
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
build:
|
||||||
strategy:
|
uses: charmbracelet/meta/.github/workflows/build.yml@main
|
||||||
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 }}
|
|
||||||
|
|
||||||
- name: Checkout code
|
snapshot:
|
||||||
uses: actions/checkout@v3
|
uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
|
||||||
|
secrets:
|
||||||
- name: Download Go modules
|
goreleaser_key: ${{ secrets.GORELEASER_KEY }}
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: go build -v ./...
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: go test ./...
|
|
||||||
|
|
43
.github/workflows/goreleaser.yml
vendored
43
.github/workflows/goreleaser.yml
vendored
|
@ -1,34 +1,23 @@
|
||||||
name: goreleaser
|
name: goreleaser
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
push:
|
push:
|
||||||
|
tags:
|
||||||
|
- v*.*.*
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: goreleaser
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: ubuntu-latest
|
uses: charmbracelet/meta/.github/workflows/goreleaser.yml@main
|
||||||
steps:
|
secrets:
|
||||||
- name: Checkout
|
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
uses: actions/checkout@v3
|
docker_token: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
with:
|
gh_pat: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||||
fetch-depth: 0
|
goreleaser_key: ${{ secrets.GORELEASER_KEY }}
|
||||||
- name: Set up Go
|
fury_token: ${{ secrets.FURY_TOKEN }}
|
||||||
uses: actions/setup-go@v3
|
nfpm_gpg_key: ${{ secrets.NFPM_GPG_KEY }}
|
||||||
with:
|
nfpm_passphrase: ${{ secrets.NFPM_PASSPHRASE }}
|
||||||
go-version: ~1.16
|
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||||
- 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
|
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
||||||
glow
|
glow
|
||||||
dist/
|
dist/
|
||||||
.envrc
|
.envrc
|
||||||
|
completions/
|
||||||
|
manpages/
|
110
.goreleaser.yml
110
.goreleaser.yml
|
@ -1,100 +1,12 @@
|
||||||
env:
|
includes:
|
||||||
- GO111MODULE=on
|
- from_url:
|
||||||
- CGO_ENABLED=0
|
url: charmbracelet/meta/main/goreleaser-glow.yaml
|
||||||
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"
|
|
||||||
|
|
||||||
archives:
|
variables:
|
||||||
-
|
main: "."
|
||||||
builds:
|
binary_name: glow
|
||||||
- glow
|
description: "Render markdown on the CLI, with pizzazz! 💅🏻"
|
||||||
format_overrides:
|
github_url: "https://github.com/charmbracelet/soft-serve"
|
||||||
- goos: windows
|
maintainer: "Christian Muehlhaeuser <muesli@charm.sh>"
|
||||||
format: zip
|
brew_commit_author_name: "Christian Muehlhaeuser"
|
||||||
replacements:
|
brew_commit_author_email: "muesli@charm.sh"
|
||||||
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:"
|
|
||||||
|
|
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/charm v0.8.6
|
||||||
github.com/charmbracelet/glamour v0.2.1-0.20210402234443-abe9cda419ba
|
github.com/charmbracelet/glamour v0.2.1-0.20210402234443-abe9cda419ba
|
||||||
github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
|
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/kylelemons/godebug v1.1.0 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.12
|
github.com/mattn/go-runewidth v0.0.12
|
||||||
github.com/meowgorithm/babyenv v1.3.1
|
github.com/meowgorithm/babyenv v1.3.1
|
||||||
|
@ -19,11 +18,9 @@ require (
|
||||||
github.com/muesli/termenv v0.8.1
|
github.com/muesli/termenv v0.8.1
|
||||||
github.com/sahilm/fuzzy v0.1.0
|
github.com/sahilm/fuzzy v0.1.0
|
||||||
github.com/segmentio/ksuid v1.0.3
|
github.com/segmentio/ksuid v1.0.3
|
||||||
github.com/spf13/cobra v1.4.0
|
github.com/spf13/cobra v1.5.0
|
||||||
github.com/spf13/viper v1.4.0
|
github.com/spf13/viper v1.13.0
|
||||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
|
||||||
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc // indirect
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
|
||||||
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78
|
golang.org/x/text v0.3.7
|
||||||
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf
|
|
||||||
golang.org/x/text v0.3.2
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue