Skip to content

Commit 3154a06

Browse files
committed
V0.0.1
1 parent f9086ce commit 3154a06

Some content is hidden

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

44 files changed

+2976
-6
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: xerolux

.github/dependabot.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for Go
4+
- package-ecosystem: "gomod"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
commit-message:
11+
prefix: "deps"
12+
include: "scope"
13+
labels:
14+
- "dependencies"
15+
open-pull-requests-limit: 10
16+
pull-request-branch-name:
17+
separator: "-"
18+
reviewers:
19+
- "Xerolux"
20+
21+
# Maintain dependencies for GitHub Actions
22+
- package-ecosystem: "github-actions"
23+
directory: "/"
24+
schedule:
25+
interval: "weekly"
26+
day: "monday"
27+
commit-message:
28+
prefix: "ci"
29+
include: "scope"
30+
labels:
31+
- "dependencies"
32+
- "github-actions"
33+
open-pull-requests-limit: 5
34+
reviewers:
35+
- "Xerolux"
36+
37+
# Maintain dependencies for Docker
38+
- package-ecosystem: "docker"
39+
directory: "/"
40+
schedule:
41+
interval: "monthly"
42+
commit-message:
43+
prefix: "docker"
44+
include: "scope"
45+
labels:
46+
- "dependencies"
47+
- "docker"
48+
open-pull-requests-limit: 5
49+
reviewers:
50+
- "Xerolux"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "CodeQL Security Analysis"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '0 0 * * 0' # Run once per week at midnight on Sunday
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ 'go' ]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v3
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Autobuild
35+
uses: github/codeql-action/autobuild@v3
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v3
39+
with:
40+
category: "/language:${{matrix.language}}"

.github/workflows/go.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.24.1'
19+
- name: golangci-lint
20+
uses: golangci/golangci-lint-action@v7
21+
with:
22+
version: latest
23+
args: --timeout=5m
24+
25+
test:
26+
name: Test
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up Go
31+
uses: actions/setup-go@v5
32+
with:
33+
go-version: '1.24.1'
34+
cache: true
35+
- name: Test
36+
run: go test -v ./...
37+
38+
build:
39+
name: Build
40+
needs: [lint, test]
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
go-os: [linux, darwin, windows]
45+
go-arch: [amd64, arm64]
46+
# Wenn du bestimmte Kombinationen ausschließen möchtest, entferne die Kommentarzeichen
47+
# exclude:
48+
# - go-os: windows
49+
# go-arch: arm64
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: Set up Go
53+
uses: actions/setup-go@v5
54+
with:
55+
go-version: '1.24.1'
56+
cache: true
57+
- name: Build
58+
run: |
59+
GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} go build -o tcp-multiplexer-${{ matrix.go-os }}-${{ matrix.go-arch }}${{ matrix.go-os == 'windows' && '.exe' || '' }} -v .
60+
- name: Upload Artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: tcp-multiplexer-${{ matrix.go-os }}-${{ matrix.go-arch }}
64+
path: tcp-multiplexer-${{ matrix.go-os }}-${{ matrix.go-arch }}${{ matrix.go-os == 'windows' && '.exe' || '' }}
65+
retention-days: 7
66+
67+
docker:
68+
name: Build Docker Image
69+
needs: [build]
70+
runs-on: ubuntu-latest
71+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
72+
steps:
73+
- uses: actions/checkout@v4
74+
- name: Set up Go
75+
uses: actions/setup-go@v5
76+
with:
77+
go-version: '1.24.1'
78+
cache: true
79+
- name: Build
80+
run: go build -o tcp-multiplexer
81+
- name: Set up Docker Buildx
82+
uses: docker/setup-buildx-action@v3
83+
- name: Login to Docker Hub
84+
if: env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_PASSWORD != ''
85+
uses: docker/login-action@v3
86+
with:
87+
username: ${{ secrets.DOCKERHUB_USERNAME }}
88+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
89+
- name: Login to GitHub Container Registry
90+
uses: docker/login-action@v3
91+
with:
92+
registry: ghcr.io
93+
username: ${{ github.actor }}
94+
password: ${{ secrets.GITHUB_TOKEN }}
95+
- name: Extract metadata
96+
id: meta
97+
uses: docker/metadata-action@v5
98+
with:
99+
images: |
100+
ghcr.io/xerolux/tcp-multiplexer
101+
tags: |
102+
type=raw,value=latest,enable={{is_default_branch}}
103+
type=sha,format=short
104+
- name: Build and push
105+
uses: docker/build-push-action@v6
106+
with:
107+
context: .
108+
push: true
109+
tags: ${{ steps.meta.outputs.tags }}
110+
labels: ${{ steps.meta.outputs.labels }}
111+
platforms: linux/amd64,linux/arm64

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
attestations: write
12+
13+
jobs:
14+
goreleaser:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.24.1'
25+
- name: Log in to Docker Hub
26+
if: env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_PASSWORD != ''
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
31+
- name: Log in to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Run GoReleaser
38+
uses: goreleaser/goreleaser-action@v6
39+
with:
40+
distribution: goreleaser
41+
version: latest
42+
args: release --clean
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
tcp-multiplexer
3+
dist/
4+
github.env

.goreleaser.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
version: 2
2+
before:
3+
hooks:
4+
- go mod tidy
5+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
ldflags:
9+
- -s -w -X github.com/Xerolux/tcp-multiplexer/cmd.version={{.Version}} -X github.com/Xerolux/tcp-multiplexer/cmd.commit={{.Commit}} -X github.com/Xerolux/tcp-multiplexer/cmd.date={{.Date}} -X github.com/Xerolux/tcp-multiplexer/cmd.builtBy=goreleaser
10+
goos:
11+
- linux
12+
- darwin
13+
- windows
14+
goarch:
15+
- amd64
16+
- arm64
17+
- arm
18+
goarm:
19+
- "6"
20+
- "7"
21+
archives:
22+
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
23+
format_overrides:
24+
- goos: windows
25+
format: zip
26+
checksum:
27+
name_template: 'checksums.txt'
28+
snapshot:
29+
version_template: "{{ .Tag }}-next"
30+
changelog:
31+
sort: asc
32+
filters:
33+
exclude:
34+
- '^docs:'
35+
- '^test:'
36+
dockers:
37+
- image_templates:
38+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-amd64"
39+
- "docker.io/xerolux/tcp-multiplexer:latest-amd64"
40+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-amd64"
41+
- "ghcr.io/xerolux/tcp-multiplexer:latest-amd64"
42+
use: buildx
43+
goarch: amd64
44+
dockerfile: Dockerfile.goreleaser
45+
build_flag_templates:
46+
- "--platform=linux/amd64"
47+
- image_templates:
48+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-arm64"
49+
- "docker.io/xerolux/tcp-multiplexer:latest-arm64"
50+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-arm64"
51+
- "ghcr.io/xerolux/tcp-multiplexer:latest-arm64"
52+
use: buildx
53+
goarch: arm64
54+
dockerfile: Dockerfile.goreleaser
55+
build_flag_templates:
56+
- "--platform=linux/arm64"
57+
- image_templates:
58+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v6"
59+
- "docker.io/xerolux/tcp-multiplexer:latest-arm-v6"
60+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v6"
61+
- "ghcr.io/xerolux/tcp-multiplexer:latest-arm-v6"
62+
use: buildx
63+
goarch: arm
64+
goarm: "6"
65+
dockerfile: Dockerfile.goreleaser
66+
build_flag_templates:
67+
- "--platform=linux/arm/v6"
68+
- image_templates:
69+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v7"
70+
- "docker.io/xerolux/tcp-multiplexer:latest-arm-v7"
71+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v7"
72+
- "ghcr.io/xerolux/tcp-multiplexer:latest-arm-v7"
73+
use: buildx
74+
goarch: arm
75+
goarm: "7"
76+
dockerfile: Dockerfile.goreleaser
77+
build_flag_templates:
78+
- "--platform=linux/arm/v7"
79+
docker_manifests:
80+
- name_template: "docker.io/xerolux/tcp-multiplexer:{{ .Version }}"
81+
image_templates:
82+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-amd64"
83+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-arm64"
84+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v6"
85+
- "docker.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v7"
86+
- name_template: "docker.io/xerolux/tcp-multiplexer:latest"
87+
image_templates:
88+
- "docker.io/xerolux/tcp-multiplexer:latest-amd64"
89+
- "docker.io/xerolux/tcp-multiplexer:latest-arm64"
90+
- "docker.io/xerolux/tcp-multiplexer:latest-arm-v6"
91+
- "docker.io/xerolux/tcp-multiplexer:latest-arm-v7"
92+
- name_template: "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}"
93+
image_templates:
94+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-amd64"
95+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-arm64"
96+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v6"
97+
- "ghcr.io/xerolux/tcp-multiplexer:{{ .Version }}-arm-v7"
98+
- name_template: "ghcr.io/xerolux/tcp-multiplexer:latest"
99+
image_templates:
100+
- "ghcr.io/xerolux/tcp-multiplexer:latest-amd64"
101+
- "ghcr.io/xerolux/tcp-multiplexer:latest-arm64"
102+
- "ghcr.io/xerolux/tcp-multiplexer:latest-arm-v6"
103+
- "ghcr.io/xerolux/tcp-multiplexer:latest-arm-v7"

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"makefile.configureOnOpen": false
3+
}

0 commit comments

Comments
 (0)