Skip to content

Commit

Permalink
feat: initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
muhlba91 committed Nov 2, 2023
1 parent fd0f1e3 commit e0bbe71
Show file tree
Hide file tree
Showing 32 changed files with 3,115 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"projectName": "external-dns-provider-adguard",
"projectOwner": "muhlba91",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "muhlba91",
"name": "Daniel Mühlbachler-Pietrzykowski",
"avatar_url": "https://avatars.githubusercontent.com/u/653739?v=4",
"profile": "https://muehlbachler.io/",
"contributions": [
"maintenance",
"code",
"doc"
]
}
],
"contributorsPerLine": 7,
"linkToUsage": false,
"skipCi": true,
"commitConvention": "angular",
"commitType": "docs"
}
29 changes: 29 additions & 0 deletions .conform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
policies:
- type: commit
spec:
header:
length: 200
imperative: true
case: lower
invalidLastCharacters: .
body:
required: false
dco: false
gpg: false
spellcheck:
locale: US
maximumOfOneCommit: false
conventional:
types:
- refactor
- perf
- chore
- test
- docs
- no_type
scopes:
- release
- deps
- ci
descriptionLength: 100
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @muhlba91
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: Release

on:
push:
branches:
- main

permissions:
contents: read
pull-requests: read
packages: write

env:
GO111MODULE: "on"

jobs:
release:
runs-on: ubuntu-latest
name: Release
outputs:
release_created: ${{ steps.release.outputs.releases_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
permissions:
contents: write
pull-requests: write

steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest

provider:
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
name: Publish Provider
permissions:
id-token: write
contents: write
needs:
- release
strategy:
max-parallel: 4
matrix:
go-version: [1.21.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "${{ matrix.go-version }}"

- name: Install cosign
uses: sigstore/[email protected]
- name: Download Syft
uses: anchore/sbom-action/[email protected]

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Release via GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: -p 3 release --clean --timeout 60m0s
version: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_COMMIT_TIMESTAMP: ${{ github.event.repository.updated_at }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_COMMIT_TAG: ${{ needs.release.outputs.tag_name }}
117 changes: 117 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
name: Verify

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

permissions:
contents: read
pull-requests: read
packages: read

env:
GO111MODULE: "on"

jobs:
conform:
runs-on: ubuntu-latest
name: Conform

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: siderolabs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

lint_provider:
runs-on: ubuntu-latest
name: Lint Provider
strategy:
max-parallel: 4
matrix:
go-version: [1.21.x]
golangci-lint-version: [v1.54.2]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "${{ matrix.go-version }}"

- name: Lint Provider
uses: golangci/golangci-lint-action@v3
with:
version: "${{ matrix.golangci-lint-version }}"
args: -c .golangci.yml
skip-pkg-cache: true
skip-build-cache: true

dockerfile_lint:
runs-on: ubuntu-latest
name: Lint Dockerfile

steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
fetch-depth: 0

- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile

build:
runs-on: ubuntu-latest
name: Build Provider and Container
needs:
- lint_provider
- dockerfile_lint
strategy:
max-parallel: 4
matrix:
go-version: [1.21.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "${{ matrix.go-version }}"

- name: Install cosign
uses: sigstore/[email protected]
- name: Download Syft
uses: anchore/sbom-action/[email protected]

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Release via GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: -p 3 release --snapshot --clean --skip-publish --timeout 60m0s
version: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_COMMIT_TIMESTAMP: ${{ github.event.pull_request.updated_at }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_COMMIT_TAG: ${{ github.sha }}-dev
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,go
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,go

### Go ###
# 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

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,go

local.env
23 changes: 23 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
linters:
enable:
- errcheck
- goconst
- revive
- gosec
- govet
- ineffassign
- lll
- megacheck
- misspell
- nakedret
- unconvert
- unused
enable-all: false
linters-settings:
lll:
line-length: 250
run:
skip-files:
- schema.go
- pulumiManifest.go
timeout: 10m
Loading

0 comments on commit e0bbe71

Please sign in to comment.