Skip to content

Commit

Permalink
Merge pull request #2 from kristofferlind/next
Browse files Browse the repository at this point in the history
Configuration changes
- outputs are now a dynamic list instead of 2 hardcoded entries
- actions are now set through configuration instead of a hardcoded set of available actions

Development tooling:
- test setup with bats, testing actual usage
- test and release workflows
- prepared environment for development, with direnv and nix installed everything is ready when entering directory

Security improvements:
- a massive reduction of dependencies
- no longer expects any credentials to be set (login to registries/repositories is now expected to be done prior to execution instead)
  • Loading branch information
kristofferlind authored Nov 6, 2022
2 parents 40eca6e + 916cfec commit 501fce0
Show file tree
Hide file tree
Showing 67 changed files with 1,143 additions and 2,699 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

env:
GO_VERSION: '1.19.2'

jobs:
tests:
uses: ./.github/workflows/test.yml
goreleaser:
runs-on: ubuntu-latest
needs: tests
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
pull_request:
paths-ignore:
- 'README.md'
workflow_call:

permissions:
contents: read

env:
GO_VERSION: '1.19.2'

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v3
- run: make build

test:
name: Test
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: cachix/install-nix-action@v18
- uses: actions/checkout@v3
- run: nix-shell --pure --command "make test"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
knega
notes.md

dist/
16 changes: 0 additions & 16 deletions .gometalinter.json

This file was deleted.

27 changes: 27 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
Loading

0 comments on commit 501fce0

Please sign in to comment.