Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc. updates #33

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 70 additions & 32 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: checks

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

permissions:
Expand All @@ -12,40 +16,64 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
- uses: actions/setup-go@v2
- name: Checkout
uses: actions/checkout@v4

- name: Capture Go Version
run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2

- name: Setup Cache
uses: actions/cache@v4
if: ${{ !env.ACT }}
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: ./script/bootstrap
- run: golangci-lint run ./...
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Bootstrap
run: ./script/bootstrap

- name: Lint
run: ./script/lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
- uses: actions/setup-go@v2
- name: Checkout
uses: actions/checkout@v4

- name: Capture Go Version
run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2

- name: Setup Cache
uses: actions/cache@v4
if: ${{ !env.ACT }}
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: ./script/bootstrap
- run: ./script/test
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Bootstrap
run: ./script/bootstrap

- name: Lint
run: ./script/test

snapshot:
needs:
Expand All @@ -54,28 +82,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags
- run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
- uses: actions/setup-go@v2

- name: Capture Go Version
run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2

- name: Setup Cache
uses: actions/cache@v4
if: ${{ !env.ACT }}
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# EOF
29 changes: 18 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,34 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch all tags
run: |

git fetch --force --tags
- run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
- uses: actions/setup-go@v2

- name: Capture Go Version
run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2

- name: Setup Cache
uses: actions/cache@v4
if: ${{ !env.ACT }}
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
Expand Down
18 changes: 0 additions & 18 deletions .golangci.yaml

This file was deleted.

11 changes: 3 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Make sure to check the documentation at https://goreleaser.com
version: 2
before:
hooks:
- go mod tidy
Expand All @@ -24,18 +25,12 @@ builds:
- "linux_ppc64le"
archives:
- id: default
replacements:
"darwin": "macos"
"386": "i386"
- id: binaries
format: binary
replacements:
"darwin": "macos"
"386": "i386"
brews:
- ids:
- "default"
tap:
repository:
owner: docwhat
name: homebrew-tap
commit_author:
Expand All @@ -46,7 +41,7 @@ brews:
system "#{bin}/temple /etc/hosts"
install: |
bin.install "temple"
folder: "Formula"
directory: "Formula"
homepage: "https://github.com/docwhat/temple"
description: "Sick of sed? Prosaic about perl? Use temple to substitute your variables!"
license: "MIT"
Expand Down
5 changes: 5 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier

# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md
MD033: false
1 change: 1 addition & 0 deletions .trunk/actions
1 change: 1 addition & 0 deletions .trunk/logs
1 change: 1 addition & 0 deletions .trunk/notifications
1 change: 1 addition & 0 deletions .trunk/out
1 change: 1 addition & 0 deletions .trunk/plugins/trunk
1 change: 1 addition & 0 deletions .trunk/tools
14 changes: 9 additions & 5 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cli:
plugins:
sources:
- id: trunk
ref: v1.6.0
ref: v1.6.1
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
Expand All @@ -19,20 +19,24 @@ runtimes:
lint:
enabled:
- actionlint@1.7.1
- checkov@3.2.184
- checkov@3.2.191
- git-diff-check
- gofmt@1.20.4
- golangci-lint@1.59.1
- hadolint@2.12.0
- markdownlint@0.41.0
- osv-scanner@1.8.2
- prettier@3.3.2
- prettier@3.3.3
- shellcheck@0.10.0
- shfmt@3.6.0
- taplo@0.8.1
- trivy@0.52.2
- taplo@0.9.2
- trivy@0.53.0
- trufflehog@3.79.0
- yamllint@1.35.1
ignore:
- linters: [ALL]
paths:
- examples/**
actions:
enabled:
- trunk-announce
Expand Down
43 changes: 20 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Contributing
============
# Contributing

I love pull requests from everyone!

Getting Started
---------------
## Getting Started

### Install Go

Expand All @@ -16,26 +14,26 @@ If you will be contributing, then you'll want to [fork the repository](https://h

Once you've forked it, then you can clone the source:

``` sh
$ git clone git@github.com:<your-username>/<repository-name>.git
```sh
git clone git@github.com:<your-username>/<repository-name>.git
```

Fetch the required dependencies:

``` sh
$ script/bootstrap
```sh
script/bootstrap
```

Before you do any changes, make sure the tests pass:

``` sh
$ script/test
```sh
script/test
```

Make your change. Add tests for your change. Make the tests pass:

``` sh
$ script/test
```sh
script/test
```

Push to your fork and [submit a pull request](https://help.github.com/articles/creating-a-pull-request/).
Expand All @@ -47,29 +45,28 @@ Some things that will increase the chance that your pull request is accepted:
- Write tests.
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

Releases
--------
## Releases

1. Update the `CHANGELOG.md`. See [keepachangelog.com](http://keepachangelog.com/) for info.
2. Commit `CHANGELOG.md`
3. Copy the current change log entry for the version to be released.
4. Tag the new version. Example:

``` sh
$ git tag v0.1.0
```sh
git tag v0.1.0
```

5. Push up the commit and tag:

``` sh
$ git push
...
$ git push --tags
...
```sh
git push
# ...
git push --tags
# ...
```

6. Go to [the releases page](https://github.com/docwhat/temple/releases)
1. Click on "Edit"
2. The name should match the tag. e.g. `v0.1.0`
2. Paste in the change log entry.
3. Save.
3. Paste in the change log entry.
4. Save.
Loading
Loading