-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
- Loading branch information
Showing
13 changed files
with
304 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "feat" | ||
include: "scope" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "chore" | ||
include: "scope" | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "feat" | ||
include: "scope" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
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: ~1.17 | ||
|
||
- 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 -v -cover -timeout=30s ./... | ||
|
||
snapshot: | ||
uses: charmbracelet/meta/.github/workflows/snapshot.yml@main | ||
secrets: | ||
goreleaser_key: ${{ secrets.GORELEASER_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
concurrency: | ||
group: goreleaser | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
goreleaser: | ||
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 }} | ||
aur_key: ${{ secrets.AUR_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: lint-soft | ||
on: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
pull-requests: read | ||
|
||
jobs: | ||
golangci: | ||
name: lint-soft | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1 | ||
|
||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Optional: golangci-lint command line arguments. | ||
args: --config .golangci-soft.yml --issues-exit-code=0 | ||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
only-new-issues: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: lint | ||
on: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
pull-requests: read | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1 | ||
|
||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Optional: golangci-lint command line arguments. | ||
#args: | ||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
only-new-issues: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: nightly | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
nightly: | ||
uses: charmbracelet/meta/.github/workflows/nightly.yml@main | ||
secrets: | ||
docker_username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
docker_token: ${{ secrets.DOCKERHUB_TOKEN }} | ||
goreleaser_key: ${{ secrets.GORELEASER_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: soft-serve | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
soft-serve: | ||
uses: charmbracelet/meta/.github/workflows/soft-serve.yml@main | ||
secrets: | ||
ssh-key: "${{ secrets.CHARM_SOFT_SERVE_KEY }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
includes: | ||
- from_url: | ||
url: charmbracelet/meta/main/goreleaser-full.yaml | ||
|
||
variables: | ||
main: "./cmd/melt" | ||
description: "Backup and restore SSH keys as mnemonic set of words" | ||
github_url: "https://github.com/charmbracelet/melt" | ||
maintainer: "Carlos A Becker <carlos@charm.sh>" | ||
brew_commit_author_name: "Carlos A Becker" | ||
brew_commit_author_email: "carlos@charm.sh" | ||
|
||
before: | ||
hooks: | ||
- ./scripts/manpages.sh | ||
- ./scripts/completions.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM gcr.io/distroless/static | ||
COPY melt /usr/local/bin/melt | ||
ENTRYPOINT [ "/usr/local/bin/melt" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/matryer/is" | ||
) | ||
|
||
func TestMaybeFile(t *testing.T) { | ||
t.Run("is a file", func(t *testing.T) { | ||
is := is.New(t) | ||
path := filepath.Join(t.TempDir(), "f") | ||
content := "test content" | ||
is.NoErr(os.WriteFile(path, []byte(content), 0o644)) | ||
is.Equal(content, maybeFile(path)) | ||
}) | ||
|
||
t.Run("not a file", func(t *testing.T) { | ||
is := is.New(t) | ||
is.Equal("strings", maybeFile("strings")) | ||
}) | ||
} |
Oops, something went wrong.