Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoazzem committed Feb 18, 2025
0 parents commit e325e49
Show file tree
Hide file tree
Showing 144 changed files with 14,322 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: release

on:
push:
branches:
- "main"
tags:
- "v*"

permissions:
contents: write
packages: write
id-token: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.0'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin/*
Dockerfile.cross

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Go workspace file
go.work

# Kubernetes Generated files - skip generated files, except for vendored files
!vendor/**/zz_generated.*

# editor and IDE paraphernalia
.idea
.vscode
*.swp
*.swo
*~

# os
.DS_Store

# local stuff
__*
# goreleaser
dist/
43 changes: 43 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
run:
timeout: 5m
allow-parallel-runners: true

issues:
# don't skip warning about doc comments
# don't exclude the default set of lint
exclude-use-default: false
# restore some of the defaults
# (fill in the rest as needed)
exclude-rules:
- path: "pkg/x/*"
linters:
- all
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- govet
- revive
linters:
disable-all: true
enable:
- dupl
- errcheck
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
# - lll
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
41 changes: 41 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
kos:
- repositories:
- ghcr.io/edgeflare/pgo
# - edgeflare/pgo
tags:
- "{{.Version}}"
- latest
bare: true
preserve_import_paths: false
platforms:
- linux/amd64
- linux/arm64
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing Guide

Hello and welcome! We’re excited you want to contribute to pgo. Here’s how you can help:

### Reporting Issues
Found a bug or have a suggestion? Open an issue and provide as much detail as possible.

### Code Contributions
1. **Fork the Repo:** Fork the repository to your GitHub account:
```bash
git clone git@github.com:<username>/pgo.git
```
2. **Clone Your Fork:** Clone it to your local machine:
```bash
git clone git@github.com:<username>/pgo.git
```
3. **Create a Branch:**
```bash
git checkout -b feat/feature-name # Use feat, bug, docs, etc.
```
4. **Make Changes:** Make your changes in the new branch.
5. **Commit Changes:**
```bash
git commit -m "Description of changes"
```
6. **Push to Your Repo:**
```bash
git push origin feat/feature-name
```
7. **Open a PR:** Create a pull request from your repository to the `dev` branch of `git@github.com:edgeflare/pgo.git`. Provide a clear description.

### Code Style
Follow our coding standards. If unsure, feel free to ask.

### Documentation
Update documentation for any new features.


Thank you for your contributions!
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM docker.io/golang:1.24 AS builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /workspace

COPY ./go.mod go.mod
COPY ./go.sum go.sum
RUN go mod download

COPY ./cmd cmd
COPY ./pkg pkg
COPY ./proto proto
COPY ./main.go main.go

RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o pgo .

# runtime image
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/pgo .
USER 65532:65532

ENTRYPOINT ["/pgo"]
Loading

0 comments on commit e325e49

Please sign in to comment.