Skip to content

Commit

Permalink
Merge pull request #11 from cbrgm/update-files
Browse files Browse the repository at this point in the history
chore: update all project files
  • Loading branch information
github-actions[bot] committed Dec 13, 2023
2 parents a61d592 + 5fd41a9 commit 9b4c6e4
Show file tree
Hide file tree
Showing 31 changed files with 683 additions and 236 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!bin/
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
indent_size = 4

[*.go]
indent_style = tab
indent_size = 4

[*.md]
trim_trailing_whitespace = true
13 changes: 13 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- cbrgm

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 1
10 changes: 10 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- PLEASE READ BEFORE DELETING
Please write in English, as it's a language understood by all maintainers of this project. Before submitting your issue, please take a moment to ensure it hasn't already been reported or addressed.
Additionally, we highly recommend reading our contributing guidelines to familiarize yourself with the process and increase the effectiveness of your contribution:
https://github.com/cbrgm/structuresmith/blob/main/CONTRIBUTING.md
Thank you for your help and understanding!
-->
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- PLEASE READ BEFORE DELETING
Before proceeding, ensure your pull request is targeting the main branch. Clearly describe the purpose of your pull request and the issue it addresses, if applicable. We also encourage you to read our contributing guidelines for a smoother contribution process:
https://github.com/cbrgm/structuresmith/blob/main/CONTRIBUTING.md
Thank you for your contribution!
-->
34 changes: 34 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
repository:
name: structuresmith
description: Automates the generation of project files and templates for repositories (and others) based on customizable YAML configurations.
homepage: https://cbrgm.net
topics: go, yaml, template, files, automation, repository, directories, structure, templating

private: false
has_issues: true
has_wiki: false
has_downloads: false

default_branch: main

allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: true

allow_update_branch: true
allow_auto_merge: true
delete_branch_on_merge: true
enable_automated_security_fixes: true
enable_vulnerability_alerts: true

branches:
- name: main
protection:
required_pull_request_reviews: null
required_status_checks:
strict: true
contexts:
- testing
enforce_admins: true
...
13 changes: 13 additions & 0 deletions .github/workflows/autoassign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: 'add-reviews'
on:
pull_request_target:
types: [opened, ready_for_review]

jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/auto-assign-action@v1.2.5

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

on: pull_request_target

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'

steps:

- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: ${{ secrets.BOT_PAT_TOKEN }}

- name: Approve request
id: approve
run: gh pr review --approve ${{ github.event.pull_request.html_url }}
env:
GH_TOKEN: ${{ secrets.BOT_PAT_TOKEN }}

- name: Enable automerge
id: automerge
run: gh pr merge --rebase --auto ${{ github.event.pull_request.html_url }}
env:
GH_TOKEN: ${{ secrets.BOT_PAT_TOKEN }}

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

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- v*

permissions:
contents: read
packages: write

jobs:
container:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}

strategy:
matrix:
include:
- platform: linux/386
goos: linux
goarch: 386
- platform: linux/amd64
goos: linux
goarch: amd64
- platform: linux/arm/6
goos: linux
goarch: arm
goarm: 6
- platform: linux/arm64
goos: linux
goarch: arm64

steps:

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PAT_TOKEN }}

- name: Setup golang
id: golang
uses: actions/setup-go@v5
with:
go-version: ^1.21

- name: Run generate
id: generate
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
run: make generate

- name: Run build
id: build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
run: make build

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/cbrgm/structuresmith
labels: |
org.opencontainers.image.vendor=cbrgm
maintainer=Chris Bargmann <github@cbrgm.net>
tags: |
type=ref,event=pr
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
flavor: |
suffix=-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Setup qemu
id: qemu
uses: docker/setup-qemu-action@v3

- name: Setup buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Ghcr login
id: login3
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: cbrgm
password: ${{ secrets.BOT_PAT_TOKEN }}

- name: Build image
id: publish
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
provenance: false
file: Dockerfile.${{ matrix.goos }}.${{ matrix.goarch }}
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}

manifest:
runs-on: ubuntu-latest
needs: container
if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}

steps:

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PAT_TOKEN }}

- name: Ghcr tags
id: ghcrTags
if: github.event_name != 'pull_request'
uses: docker/metadata-action@v5
with:
images: ghcr.io/cbrgm/structuresmith
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: Ghcr manifest
id: ghcr
if: github.event_name != 'pull_request'
uses: actionhippie/manifest@v1
with:
username: cbrgm
password: ${{ secrets.BOT_PAT_TOKEN }}
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v6
template: ghcr.io/cbrgm/structuresmith:VERSION-OS-ARCH
target: ${{ steps.ghcrTags.outputs.tags }}
ignore_missing: true

47 changes: 47 additions & 0 deletions .github/workflows/go-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: go-binaries

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- v*

permissions:
contents: write

jobs:
binaries:
runs-on: ubuntu-latest

steps:
- name: Checkout source
id: source
uses: actions/checkout@v4

- name: Setup golang
id: golang
uses: actions/setup-go@v5
with:
go-version: ^1.21

- name: Run generate
id: generate
run: make generate

- name: Run release
id: release
run: make release

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
files: "dist/*"
...
26 changes: 0 additions & 26 deletions .github/workflows/go-build.yml

This file was deleted.

Loading

0 comments on commit 9b4c6e4

Please sign in to comment.