Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 32e98be

Browse files
committed
Initial commit
0 parents  commit 32e98be

916 files changed

Lines changed: 324986 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
vendor: true
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"

.github/workflows/codeql.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 🚨 CodeQL Analysis
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- develop
8+
jobs:
9+
analyze:
10+
name: Analyze
11+
runs-on: ubuntu-latest
12+
permissions:
13+
actions: read
14+
contents: read
15+
security-events: write
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
language: ["go"]
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
# Initializes the CodeQL tools for scanning.
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v2
29+
with:
30+
languages: ${{ matrix.language }}
31+
32+
- name: Autobuild
33+
uses: github/codeql-action/autobuild@v2
34+
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v2

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 🎉 Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*" # Trigger on all tags
7+
8+
jobs:
9+
release:
10+
name: Release
11+
uses: ./.github/workflows/reusable-build.yml
12+
with:
13+
goreleaser_config: goreleaser.yml
14+
goreleaser_options: "--clean"
15+
secrets: inherit
16+
permissions:
17+
id-token: write # For cosign
18+
packages: write # For GHCR
19+
contents: write # To upload archives as release assets
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Reusable Build
2+
on:
3+
workflow_call:
4+
inputs:
5+
goreleaser_config:
6+
description: "file path to GoReleaser config"
7+
required: true
8+
type: string
9+
goreleaser_options:
10+
description: "GoReleaser options separated by spaces"
11+
default: ""
12+
required: false
13+
type: string
14+
15+
env:
16+
GO_VERSION: "1.22"
17+
18+
jobs:
19+
build:
20+
name: Build
21+
runs-on: ubuntu-latest
22+
env:
23+
DOCKER_CLI_EXPERIMENTAL: "enabled"
24+
steps:
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Set up Docker Buildx
29+
id: buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Install cosign
33+
uses: sigstore/[email protected]
34+
35+
- name: Install Syft
36+
uses: anchore/sbom-action/[email protected]
37+
38+
- name: Login to ghcr.io registry
39+
uses: docker/login-action@v3
40+
with:
41+
registry: ghcr.io
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Checkout code
46+
uses: actions/[email protected]
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Setup Go
51+
uses: actions/setup-go@v5
52+
with:
53+
go-version: ${{ env.GO_VERSION }}
54+
cache: false # Disable cache to avoid free space issues during `Post Setup Go` step.
55+
56+
# Create tmp dir for GoReleaser
57+
- name: "create tmp dir"
58+
run: |
59+
mkdir tmp
60+
61+
- name: GoReleaser
62+
uses: goreleaser/goreleaser-action@v6
63+
with:
64+
version: v2.0.0
65+
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}}
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
TMPDIR: "tmp"

.github/workflows/test-build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 🔨 Build Test
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build:
10+
name: Test Build
11+
uses: ./.github/workflows/reusable-build.yml
12+
with:
13+
goreleaser_config: goreleaser.yml
14+
goreleaser_options: "--clean --snapshot"
15+
secrets: inherit
16+
permissions:
17+
id-token: write # For cosign
18+
packages: write # For GHCR
19+
contents: read # Not required for public repositories, but for clarity

.github/workflows/verify.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 🙏🏻 Verify
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**.*"
7+
push:
8+
branches:
9+
- develop
10+
jobs:
11+
verify:
12+
name: Verify
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
- name: Godel Verify
18+
run: ./godelw verify

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Go workspace file
18+
go.work
19+
go.work.sum
20+
21+
# Godel
22+
/conjure/build
23+
/out/
24+
25+
# Goreleaser
26+
/dist
27+
/artifacts
28+
/output
29+
30+
# Env Files
31+
.env/
32+
!.env/example.env
33+
34+
# Don't ignore vendors
35+
!vendor/**

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM alpine:3.20
2+
3+
ARG CLI_NAME="codeanalyzevcs"
4+
5+
6+
RUN apk update && apk add --no-cache bash ca-certificates
7+
8+
# Setup Method Directory Structure
9+
RUN \
10+
mkdir -p /opt/method/${CLI_NAME}/ && \
11+
mkdir -p /opt/method/${CLI_NAME}/var/data && \
12+
mkdir -p /opt/method/${CLI_NAME}/var/data/tmp && \
13+
mkdir -p /opt/method/${CLI_NAME}/var/conf && \
14+
mkdir -p /opt/method/${CLI_NAME}/var/log && \
15+
mkdir -p /opt/method/${CLI_NAME}/service/bin && \
16+
mkdir -p /mnt/output
17+
18+
COPY ${CLI_NAME} /opt/method/${CLI_NAME}/service/bin/${CLI_NAME}
19+
20+
RUN \
21+
adduser --disabled-password --gecos '' method && \
22+
chown -R method:method /opt/method/${CLI_NAME}/ && \
23+
chown -R method:method /mnt/output
24+
25+
USER method
26+
27+
WORKDIR /opt/method/${CLI_NAME}/
28+
29+
ENV PATH="/opt/method/${CLI_NAME}/service/bin:${PATH}"

0 commit comments

Comments
 (0)