Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xx4h committed Sep 30, 2024
0 parents commit 3b63b4b
Show file tree
Hide file tree
Showing 32 changed files with 2,466 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/linter-full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Lint Code Base

on:
workflow_dispatch:
push:
branches: main

permissions: { }

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
# To report github actions status checks
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed
# files within `super-linter`
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter@v6
env:
# validate full codebase
VALIDATE_ALL_CODEBASE: true
VALIDATE_JSCPD: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/linter-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Lint Pull Request

on:
workflow_dispatch:
pull_request:
branches: main

permissions: { }

jobs:
build:
name: Lint Pull Request
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
# To report github actions status checks
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed
# files within `super-linter`
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter@v6
env:
# only validate new or edited files
VALIDATE_ALL_CODEBASE: false
VALIDATE_JSCPD: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/release-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- name: Release Changelog Builder
uses: mikepenz/release-changelog-builder-action@v5

44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# .github/workflows/release.yml
name: release

on:
pull_request:
push:
# run only against tags
tags:
- "*"

permissions:
contents: write
# packages: write
# issues: write
# id-token: write

jobs:
release:
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: stable
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- name: Release Changelog Builder
uses: mikepenz/release-changelog-builder-action@v5
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
.env

## hctl specifics
# exlude bin/ for builds
bin/
# exclude _dist/ for dist builds
_dist/
# exclude local hctl.yaml file
/hctl.yaml
# explicitly include hctl.example.yaml
!/hctl.example.yaml

dist/
46 changes: 46 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
- freebsd
flags:
- -trimpath
ldflags:
- -s -w
- -X github.com/xx4h/hctl/cmd.version=v{{.Version}}
- -X github.com/xx4h/hctl/cmd.commit={{.Commit}}
- -X github.com/xx4h/hctl/cmd.date={{.Date}}
main: ./cmd/hctl

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os|tolower }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

changelog:
disable: true
Loading

0 comments on commit 3b63b4b

Please sign in to comment.