Skip to content

Commit

Permalink
chore: Add release automation
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Raja Yogidas <[email protected]>
  • Loading branch information
coderbirju committed Sep 5, 2024
1 parent df31cb6 commit bb7500d
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
- name: Ask a question
url: https://github.com/runfinch/finch-daemon/discussions
about: Use GitHub Discussions to ask questions, discuss options, or propose new ideas
28 changes: 14 additions & 14 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "build"
include: "scope"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "ci"
include: "scope"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "build"
include: "scope"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "ci"
include: "scope"
125 changes: 62 additions & 63 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,67 @@
name: CI
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
env:
GO_VERSION: '1.22.6'

jobs:
git-secrets:
runs-on: ubuntu-latest
steps:
- name: Pull latest awslabs/git-secrets repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: awslabs/git-secrets
ref: 1.3.0
fetch-tags: true
path: git-secrets
- name: Install git secrets from source
run: sudo make install
working-directory: git-secrets
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Scan repository for git secrets
run: |
git secrets --register-aws
git secrets --scan-history
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Checkout finch-deamon repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build and run unit tests
run: |
make build
make run-unit-tests
e2e-test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout finch-daemon repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Dependencies for e2e Testing
run: ./setup-test-env.sh
- name: Build the daemon
run: make build
- name: Remove default podman network config
run: |
sudo ls /etc/cni/net.d
sudo rm /etc/cni/net.d/87-podman-bridge.conflist
- name: Start finch-daemon
run: sudo bin/finch-daemon --debug --socket-owner $UID &
- name: Run e2e test
run: sudo make run-e2e-tests
git-secrets:
runs-on: ubuntu-latest
steps:
- name: Pull latest awslabs/git-secrets repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: awslabs/git-secrets
ref: 1.3.0
fetch-tags: true
path: git-secrets
- name: Install git secrets from source
run: sudo make install
working-directory: git-secrets
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Scan repository for git secrets
run: |
git secrets --register-aws
git secrets --scan-history
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Checkout finch-deamon repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build and run unit tests
run: |
make build
make run-unit-tests
e2e-test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout finch-daemon repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Dependencies for e2e Testing
run: ./setup-test-env.sh
- name: Build the daemon
run: make build
- name: Remove default podman network config
run: |
sudo ls /etc/cni/net.d
sudo rm /etc/cni/net.d/87-podman-bridge.conflist
- name: Start finch-daemon
run: sudo bin/finch-daemon --debug --socket-owner $UID &
- name: Run e2e test
run: sudo make run-e2e-tests
11 changes: 11 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# When a third-party action is added (i.e., `uses`), please also add it to `download-licenses` in Makefile.
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
3 changes: 0 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ linters-settings:
require-specific: true
stylecheck:
checks: ["all", "-ST1003", "-ST1000", "-ST1001", "-ST1021"]

linters:
enable:
# - errname
Expand Down Expand Up @@ -56,14 +55,12 @@ linters:
- stylecheck
disable:
- errcheck

issues:
exclude-rules:
- linters:
- lll
# A go:generate statement has to be in the same line: https://github.com/golang/go/issues/46050.
source: "^//go:generate "

# Some checks enabled in the stylecheck setting are disabled by default
# (e.g., https://golangci-lint.run/usage/false-positives/#exc0013),
# so we need to enable them explicitly here.
Expand Down
59 changes: 59 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "go",
"changelog-sections": [
{
"type": "build",
"section": "Build System or External Dependencies",
"hidden": false
},
{
"type": "exp",
"section": "Experimental",
"hidden": false
},
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "revert",
"section": "Reverts",
"hidden": false
},
{
"type": "chore",
"section": "Miscellaneous Chores",
"hidden": true
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": true
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
],
"packages": {
".": {}
}
}

0 comments on commit bb7500d

Please sign in to comment.