Skip to content

Commit

Permalink
Merge pull request #6 from simplifi/setup-github
Browse files Browse the repository at this point in the history
Setup GitHub
  • Loading branch information
cjonesy authored Sep 10, 2024
2 parents 3ce13e4 + bf93559 commit 17bcb2c
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/.dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 99
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 99
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Codeowners file
# See https://help.github.com/articles/about-code-owners/ for syntax information.
# Note that later entries override previous entries.

* @simplifi/capybaras
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build

on:
push:
pull_request:
branches:
- main

permissions:
contents: write

jobs:
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
-
name: Run Tests
run: make test
-
name: Dry Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --snapshot --skip=publish --clean
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.SIFI_GITHUB_RUNNER_BOT_RELEASE_TOKEN }}
10 changes: 10 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: danger

on:
pull_request:
types: [edited, opened, ready_for_review, reopened, synchronize]

jobs:
danger:
uses: simplifi/sifi-danger/.github/workflows/run-danger.yml@main
secrets: inherit
28 changes: 28 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2

before:
hooks:
- go mod tidy

builds:
- dir: ./cmd/goverseer
env:
- CGO_ENABLED=0
flags:
- -v
ldflags:
- -X github.com/simplifi/goverseer/internal/goverseer/version.Version={{.Version}}
targets:
- go_first_class

archives:
- format: tar.gz
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "checksums.txt"

changelog:
disable: true
1 change: 1 addition & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
danger.import_dangerfile(github: 'simplifi/sifi-danger')
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ fmt:
vet:
go vet ./...

# Run a test release with goreleaser
.PHONY: test-release
test-release:
goreleaser release --snapshot --skip=publish --clean

# Clean up any cruft left over from old builds
.PHONY: clean
clean:
Expand All @@ -42,3 +47,8 @@ build: clean
tag:
git tag -a $(TAG) -m "Release $(TAG)"
git push origin $(TAG)

# Requires GITHUB_TOKEN environment variable to be set
.PHONY: release
release: clean
goreleaser release --clean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package time
package time_watcher

import (
"log/slog"
Expand Down

0 comments on commit 17bcb2c

Please sign in to comment.