Skip to content

Commit

Permalink
feat(ci): add workflows and goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Jul 8, 2022
1 parent 3052fd3 commit ab32d1a
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 27 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
name: build
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
go-version: [~1.17]
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 }}

- name: Checkout code
uses: actions/checkout@v2

- name: Download Go modules
run: go mod download
on: [push, pull_request]

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

- name: Test
run: go test ./...
snapshot:
uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
secrets:
goreleaser_key: ${{ secrets.GORELEASER_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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 }}
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: lint
on: [push, pull_request]
on:
push:
pull_request:

jobs:
golangci:
Expand All @@ -12,7 +14,5 @@ jobs:
with:
# Optional: golangci-lint command line arguments.
args: --issues-exit-code=0
# Optional: working directory, useful for monorepos
# working-directory: somedir
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
12 changes: 12 additions & 0 deletions .github/workflows/soft-serve.yml
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 }}"
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
includes:
- from_url:
url: charmbracelet/meta/main/goreleaser-lib.yaml

0 comments on commit ab32d1a

Please sign in to comment.