Skip to content

Commit b389edc

Browse files
authored
Initial commit
0 parents  commit b389edc

19 files changed

+597
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### Summary
2+
3+
SUMMARY_GOES_HERE
4+
5+
### Full changelog
6+
7+
* [Implement ...]
8+
* [Fix ...]
9+
10+
### Issues resolved
11+
12+
Fix #XXX
13+
14+
### Documentation
15+
16+
- [ ] Link to the website [documentation PR](https://github.com/Kong/docs.konghq.com/pull/XXX)
17+
18+
### Testing
19+
20+
- [ ] Unit tests
21+
- [ ] E2E tests
22+
- [ ] Manual testing on Universal
23+
- [ ] Manual testing on Kubernetes

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
# File is synced from Kong/template-generic and will be overwritten
3+
version: 2
4+
updates:
5+
- package-ecosystem: docker
6+
directory: /
7+
schedule:
8+
interval: daily
9+
10+
- package-ecosystem: github-actions
11+
directory: /
12+
schedule:
13+
interval: daily

.github/settings.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
3+
4+
repository:
5+
# See https://docs.github.com/en/rest/reference/repos#update-a-repository for all available settings.
6+
7+
# The name of the repository. Changing this will rename the repository
8+
# name: repo-name
9+
10+
# A short description of the repository that will show up on GitHub
11+
# description: description of repo
12+
13+
# A URL with more information about the repository
14+
# homepage: https://example.github.io/
15+
16+
# A comma-separated list of topics to set on the repository
17+
# topics: github, probot
18+
19+
# Either `true` to make the repository private, or `false` to make it public.
20+
private: false
21+
22+
# Either `true` to enable issues for this repository, `false` to disable them.
23+
has_issues: false
24+
25+
# Either `true` to enable projects for this repository, or `false` to disable them.
26+
# If projects are disabled for the organization, passing `true` will cause an API error.
27+
has_projects: false
28+
29+
# Either `true` to enable the wiki for this repository, `false` to disable it.
30+
has_wiki: false
31+
32+
# Either `true` to enable downloads for this repository, `false` to disable them.
33+
has_downloads: true
34+
35+
# Updates the default branch for this repository.
36+
default_branch: main
37+
38+
# Either `true` to allow squash-merging pull requests, or `false` to prevent
39+
# squash-merging.
40+
allow_squash_merge: true
41+
42+
# Either `true` to allow merging pull requests with a merge commit, or `false`
43+
# to prevent merging pull requests with merge commits.
44+
allow_merge_commit: false
45+
46+
# Either `true` to allow rebase-merging pull requests, or `false` to prevent
47+
# rebase-merging.
48+
allow_rebase_merge: true
49+
50+
# Either `true` to enable automatic deletion of branches on merge, or `false` to disable
51+
delete_branch_on_merge: true
52+
53+
# Either `true` to enable automated security fixes, or `false` to disable
54+
# automated security fixes.
55+
enable_automated_security_fixes: true
56+
57+
# Either `true` to enable vulnerability alerts, or `false` to disable
58+
# vulnerability alerts.
59+
enable_vulnerability_alerts: true
60+
61+
branches:
62+
- name: main
63+
protection:
64+
required_pull_request_reviews:
65+
required_status_checks:
66+
strict: true
67+
contexts: [pre-commit, Create Release, 'Create Release Artifacts (aarch64, linux-gnu)', 'Create Release Artifacts (aarch64, linux-musl)', 'Create
68+
Release Artifacts (x86_64, linux-gnu)', 'Create Release Artifacts (x86_64, linux-musl)']
69+
enforce_admins:
70+
required_linear_history: true
71+
restrictions:

.github/template-sync.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
additional:
3+
- kong-openssl
4+
5+
files:
6+
- '!README.md'
7+
- '!.pre-commit-config.yaml'
8+
- '!.secrets.baseline'
9+
- '!**/template-sync.yml'
10+
- '!.github/workflows/sync.yml'
11+
- '!.github/PULL_REQUEST_TEMPLATE.md'
12+
- '!**/CODEOWNERS'
13+
- '!.yamllint'
14+
- '!Dockerfile'
15+
- '!build.sh'
16+
- '!test.sh'
17+
- '!.github/workflows/release.yaml'
18+
- '!.releaserc'
19+
- '!Makefile'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# File is synced from Kong/template-generic and will be overwritten
3+
name: Auto Actions
4+
5+
on: pull_request_target # yamllint disable-line rule:truthy
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
12+
jobs:
13+
dependabot-automerge:
14+
runs-on: ubuntu-latest
15+
if: ${{ github.actor == 'dependabot[bot]' }}
16+
steps:
17+
- name: Gather Dependabot metadata
18+
id: metadata
19+
uses: dependabot/fetch-metadata@v1.3.5
20+
with:
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Approve PR
23+
run: gh pr review --approve "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
- name: Enable auto-merge
28+
run: gh pr merge --auto --squash "$PR_URL"
29+
env:
30+
PR_URL: ${{github.event.pull_request.html_url}}
31+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/pre-commit.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# File is synced from Kong/template-generic and will be overwritten
3+
name: pre-commit
4+
5+
on: # yamllint disable-line rule:truthy
6+
pull_request:
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- uses: actions/setup-python@v4.3.0
16+
- name: install shfmt
17+
run: |
18+
mkdir -p $GITHUB_WORKSPACE/bin
19+
curl -L -s -o $GITHUB_WORKSPACE/bin/shfmt https://github.com/mvdan/sh/releases/download/v3.1.2/shfmt_v3.1.2_linux_amd64
20+
chmod +x $GITHUB_WORKSPACE/bin/shfmt
21+
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
22+
- name: pre-commit github auth
23+
env:
24+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
run: |
26+
git version
27+
git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "git@github.com:"
28+
- uses: pre-commit/action@v3.0.0
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
extra_args: --from-ref origin/${{ github.base_ref }} --to-ref ${{github.event.pull_request.head.sha}}

.github/workflows/release.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: Release
3+
4+
on: # yamllint disable-line rule:truthy
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13+
14+
jobs:
15+
release:
16+
name: Create Release
17+
runs-on: ubuntu-latest
18+
outputs:
19+
published: ${{ steps.release.outputs.published }}
20+
release-git-tag: ${{ steps.release.outputs.release-git-tag }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Release
25+
id: release
26+
uses: ahmadnassri/action-semantic-release@v2.1.10
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
artifacts:
31+
needs: release
32+
name: Create Release Artifacts
33+
strategy:
34+
matrix:
35+
architecture: [aarch64, x86_64]
36+
ostype: [linux-gnu, linux-musl]
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
- uses: docker/setup-qemu-action@v2
41+
- uses: docker/setup-buildx-action@v2
42+
- name: Set environment variables
43+
run: |
44+
echo "ARCHITECTURE=${{ matrix.architecture }}" >> $GITHUB_ENV
45+
echo "OSTYPE=${{ matrix.ostype }}" >> $GITHUB_ENV
46+
echo "REGISTRY=ghcr.io"
47+
- name: Build, and Package
48+
run: make build/package
49+
- name: Log in to the Container registry
50+
if: ${{ needs.release.outputs.published == 'true' }}
51+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Docker meta
57+
if: ${{ needs.release.outputs.published == 'true' }}
58+
id: meta
59+
uses: docker/metadata-action@v4
60+
with:
61+
images: ghcr.io/kong/template-github-release
62+
sep-tags: ' '
63+
flavor: |
64+
suffix=-${{ matrix.architecture }}-${{ matrix.ostype }}
65+
tags: |
66+
type=sha
67+
type=ref,event=branch
68+
type=semver,pattern={{version}},value=${{ needs.release.outputs.release-git-tag }}
69+
type=semver,pattern={{major}},value=${{ needs.release.outputs.release-git-tag }}
70+
- name: Retag and Push
71+
if: ${{ needs.release.outputs.published == 'true' }}
72+
run: |
73+
for tag in ${{ steps.meta.outputs.tags }}; do \
74+
docker tag ghcr.io/template-github-release:build-$ARCHITECTURE-$OSTYPE $tag && \
75+
docker push $tag; \
76+
done
77+
- name: Archive the package
78+
if: ${{ needs.release.outputs.published == 'true' }}
79+
run: |
80+
tar -C package -czvf ${{ matrix.architecture }}-${{ matrix.ostype }}.tar.gz .
81+
- name: Add Release Artifact to the Github Release
82+
if: ${{ needs.release.outputs.published == 'true' }}
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
tag_name: ${{ needs.release.outputs.release-git-tag }}
86+
files: ${{ matrix.architecture }}-${{ matrix.ostype }}.tar.gz

.github/workflows/sync.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Sync the template repository
3+
4+
on: # yamllint disable-line rule:truthy
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
sync:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Queue
15+
uses: ahmadnassri/action-workflow-queue@v1.1
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
- name: Sync
19+
uses: ahmadnassri/action-template-repository-sync@v2.2.0
20+
with:
21+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# File is synced from Kong/template-generic and will be overwritten
3+
repos:
4+
- repo: meta
5+
hooks:
6+
- id: check-hooks-apply
7+
- id: check-useless-excludes
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v4.0.1
10+
hooks:
11+
- id: end-of-file-fixer
12+
- id: trailing-whitespace
13+
- id: mixed-line-ending
14+
- id: check-yaml
15+
- id: check-byte-order-marker
16+
- id: check-merge-conflict
17+
- id: end-of-file-fixer
18+
- id: check-added-large-files
19+
- repo: https://github.com/Lucas-C/pre-commit-hooks
20+
rev: v1.1.10
21+
hooks:
22+
- id: forbid-crlf
23+
- id: remove-crlf
24+
- id: forbid-tabs
25+
- id: remove-tabs
26+
- repo: https://github.com/Yelp/detect-secrets
27+
rev: v1.1.0
28+
hooks:
29+
- id: detect-secrets
30+
args: [--baseline, .secrets.baseline]
31+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
32+
rev: 0.1.1
33+
hooks:
34+
- id: yamlfmt
35+
args: [--mapping, '2', --sequence, '2', --offset, '0', --width, '150']
36+
- repo: https://github.com/adrienverge/yamllint
37+
rev: v1.26.1
38+
hooks:
39+
- id: yamllint
40+
args: [--format, parsable, --strict]

0 commit comments

Comments
 (0)