Skip to content

Commit

Permalink
feat(ci): add CD/CI pipelines
Browse files Browse the repository at this point in the history
- Enable Dependabot
- Run build/test pipelines
- Add GoReleaser release/nightly pipelines
- Add lint pipelines
  • Loading branch information
aymanbagabas committed Jul 13, 2023
1 parent 79edec1 commit 03fd120
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: build

on: [push, pull_request]

jobs:
build:
uses: charmbracelet/meta/.github/workflows/build.yml@main

snapshot:
uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
secrets:
goreleaser_key: ${{ secrets.GORELEASER_KEY }}
24 changes: 24 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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 }}
fury_token: ${{ secrets.FURY_TOKEN }}
nfpm_gpg_key: ${{ secrets.NFPM_GPG_KEY }}
nfpm_passphrase: ${{ secrets.NFPM_PASSPHRASE }}

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: lint
on:
push:
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ^1
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: golangci-lint command line arguments.
args: --issues-exit-code=0
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
14 changes: 14 additions & 0 deletions .github/workflows/nightly.yml
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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.gif
*.pdf
dist
47 changes: 47 additions & 0 deletions .golangci-soft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
run:
tests: false

issues:
include:
- EXC0001
- EXC0005
- EXC0011
- EXC0012
- EXC0013

max-issues-per-linter: 0
max-same-issues: 0

linters:
enable:
# - dupl
- exhaustive
# - exhaustivestruct
- goconst
- godot
- godox
- gomnd
- gomoddirectives
- goprintffuncname
- ifshort
# - lll
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- prealloc
- wrapcheck

# disable default linters, they are already enabled in .golangci.yml
disable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
29 changes: 29 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
run:
tests: false

issues:
include:
- EXC0001
- EXC0005
- EXC0011
- EXC0012
- EXC0013

max-issues-per-linter: 0
max-same-issues: 0

linters:
enable:
- bodyclose
- exportloopref
- goimports
- gosec
- nilerr
- predeclared
- revive
- rowserrcheck
- sqlclosecheck
- tparallel
- unconvert
- unparam
- whitespace
13 changes: 13 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
includes:
- from_url:
url: charmbracelet/meta/main/goreleaser-simple.yaml

variables:
main: "."
binary_name: pop
description: "Send emails from your terminal. 📬"
github_url: "https://github.com/charmbracelet/pop"
maintainer: "Maas Lalani <maas@charm.sh>"
brew_commit_author_name: "Maas Lalani"
brew_commit_author_email: "maas@charm.sh"
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json

0 comments on commit 03fd120

Please sign in to comment.