Skip to content

Commit

Permalink
feat: 🎸 github actions & goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Aug 5, 2022
1 parent 6dabf5f commit fb99851
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test and coverage

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- name: Run coverage
run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Build
run: go build -v ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- '*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
environment: production
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Fetch all tags
run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
47 changes: 47 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./
binary: yatas
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: '{{ .Tag }}-next'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
brews:
- name: yatas
homepage: https://github.com/stangirard/yatas
tap:
owner: stangirard
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
nfpms:
- maintainer: stan@primates.dev <stan@primates.dev>
description: Aws Cost Report
homepage: https://github.com/stangirard/yatas
license: Apache 2.0
file_name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
formats:
- deb

0 comments on commit fb99851

Please # to comment.