Skip to content

Commit 7425ec1

Browse files
committed
πŸ¦ˆπŸ πŸœβ— Initial Commit β—πŸœπŸ¦ˆπŸ 
0 parents  commit 7425ec1

40 files changed

Lines changed: 8037 additions & 0 deletions

β€Ž.claude/settings.local.jsonβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Read(//root/Projects/github/apimgr/**)",
5+
"Bash(go mod:*)",
6+
"Bash(go build:*)",
7+
"Bash(curl:*)",
8+
"Bash(pkill:*)",
9+
"Bash(tree:*)",
10+
"Bash(wc:*)",
11+
"Bash(./anime --version)",
12+
"Bash(go get:*)",
13+
"Read(//tmp/**)",
14+
"Bash(xargs -I {} sh -c 'echo \"\"\"\"=== {} ===\"\"\"\" && head -20 {} && echo \"\"\"\"\"\"\"\"')",
15+
"Bash(find:*)",
16+
"Bash(cat:*)"
17+
],
18+
"deny": [],
19+
"ask": []
20+
}
21+
}

β€Ž.gitattributesβ€Ž

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Git Attributes for Anime Quotes API
2+
3+
# Auto detect text files and perform LF normalization
4+
* text=auto
5+
6+
# Source code
7+
*.go text eol=lf
8+
*.mod text eol=lf
9+
*.sum text eol=lf
10+
11+
# Web assets
12+
*.html text eol=lf
13+
*.css text eol=lf
14+
*.js text eol=lf
15+
*.json text eol=lf
16+
*.xml text eol=lf
17+
*.svg text eol=lf
18+
19+
# Documentation
20+
*.md text eol=lf
21+
*.txt text eol=lf
22+
LICENSE* text eol=lf
23+
README* text eol=lf
24+
25+
# Configuration files
26+
*.yml text eol=lf
27+
*.yaml text eol=lf
28+
*.toml text eol=lf
29+
*.ini text eol=lf
30+
.gitignore text eol=lf
31+
.gitattributes text eol=lf
32+
.dockerignore text eol=lf
33+
34+
# Docker
35+
Dockerfile* text eol=lf
36+
docker-compose*.yml text eol=lf
37+
38+
# Scripts
39+
*.sh text eol=lf
40+
*.bash text eol=lf
41+
Makefile text eol=lf
42+
Jenkinsfile text eol=lf
43+
44+
# Binary files
45+
*.png binary
46+
*.jpg binary
47+
*.jpeg binary
48+
*.gif binary
49+
*.ico binary
50+
*.svg binary
51+
*.pdf binary
52+
*.db binary
53+
*.sqlite binary
54+
*.sqlite3 binary
55+
56+
# Archives
57+
*.zip binary
58+
*.tar binary
59+
*.gz binary
60+
*.tgz binary
61+
*.bz2 binary
62+
*.7z binary
63+
*.rar binary
64+
65+
# Compiled binaries
66+
*.exe binary
67+
*.dll binary
68+
*.so binary
69+
*.dylib binary
70+
71+
# Fonts
72+
*.ttf binary
73+
*.otf binary
74+
*.woff binary
75+
*.woff2 binary
76+
*.eot binary
77+
78+
# Export ignore (files not included in releases)
79+
.github/ export-ignore
80+
.claude/ export-ignore
81+
.gitignore export-ignore
82+
.gitattributes export-ignore
83+
.dockerignore export-ignore
84+
binaries/ export-ignore
85+
releases/ export-ignore
86+
rootfs/ export-ignore
87+
coverage.out export-ignore
88+
*.log export-ignore
89+
*.tmp export-ignore
90+
91+
# Language-specific settings
92+
*.go diff=go
93+
*.md diff=markdown
94+
95+
# Linguist overrides (for GitHub language detection)
96+
src/data/*.json linguist-documentation=false
97+
*.md linguist-documentation
98+
docs/** linguist-documentation

β€Ž.github/workflows/docker.ymlβ€Ž

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build and Push Docker Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
schedule:
9+
- cron: '0 3 1 * *' # Monthly on 1st at 3 AM UTC
10+
workflow_dispatch:
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }}
15+
PROJECTNAME: anime
16+
PROJECTORG: apimgr
17+
18+
jobs:
19+
build-and-push:
20+
name: Build and Push Multi-Arch Docker Images
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
packages: write
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Read version from release.txt
30+
id: version
31+
run: |
32+
VERSION=$(cat release.txt)
33+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
34+
echo "Building Docker images for version: ${VERSION}"
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v3
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v3
41+
42+
- name: Log in to GitHub Container Registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ${{ env.REGISTRY }}
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Extract metadata for Docker
50+
id: meta
51+
uses: docker/metadata-action@v5
52+
with:
53+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
54+
tags: |
55+
type=raw,value=latest
56+
type=raw,value=${{ steps.version.outputs.VERSION }}
57+
type=sha,prefix={{branch}}-
58+
59+
- name: Build and push Docker images
60+
uses: docker/build-push-action@v5
61+
with:
62+
context: .
63+
platforms: linux/amd64,linux/arm64
64+
push: true
65+
tags: |
66+
${{ env.REGISTRY }}/${{ env.PROJECTORG }}/${{ env.PROJECTNAME }}:latest
67+
${{ env.REGISTRY }}/${{ env.PROJECTORG }}/${{ env.PROJECTNAME }}:${{ steps.version.outputs.VERSION }}
68+
build-args: |
69+
VERSION=${{ steps.version.outputs.VERSION }}
70+
COMMIT=${{ github.sha }}
71+
BUILD_DATE=${{ github.event.head_commit.timestamp }}
72+
cache-from: type=gha
73+
cache-to: type=gha,mode=max
74+
75+
- name: Verify images
76+
run: |
77+
echo "Verifying pushed images..."
78+
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.PROJECTORG }}/${{ env.PROJECTNAME }}:latest
79+
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.PROJECTORG }}/${{ env.PROJECTNAME }}:${{ steps.version.outputs.VERSION }}
80+
81+
- name: Image summary
82+
run: |
83+
echo "## Docker Images Published" >> $GITHUB_STEP_SUMMARY
84+
echo "" >> $GITHUB_STEP_SUMMARY
85+
echo "- \`${{ env.REGISTRY }}/${{ env.PROJECTORG }}/${{ env.PROJECTNAME }}:latest\`" >> $GITHUB_STEP_SUMMARY
86+
echo "- \`${{ env.REGISTRY }}/${{ env.PROJECTORG }}/${{ env.PROJECTNAME }}:${{ steps.version.outputs.VERSION }}\`" >> $GITHUB_STEP_SUMMARY
87+
echo "" >> $GITHUB_STEP_SUMMARY
88+
echo "**Platforms:** linux/amd64, linux/arm64" >> $GITHUB_STEP_SUMMARY
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build and Release Binaries
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
schedule:
9+
- cron: '0 3 1 * *' # Monthly on 1st at 3 AM UTC
10+
workflow_dispatch:
11+
12+
env:
13+
PROJECTNAME: anime
14+
PROJECTORG: apimgr
15+
16+
jobs:
17+
test:
18+
name: Run Tests
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: '1.23'
28+
29+
- name: Run tests
30+
run: make test
31+
32+
build-and-release:
33+
name: Build Binaries and Create Release
34+
needs: test
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: write
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
42+
- name: Set up Go
43+
uses: actions/setup-go@v5
44+
with:
45+
go-version: '1.23'
46+
47+
- name: Read version from release.txt
48+
id: version
49+
run: |
50+
VERSION=$(cat release.txt)
51+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
52+
echo "Building version: ${VERSION}"
53+
54+
- name: Build binaries for all platforms
55+
run: make build
56+
env:
57+
VERSION: ${{ steps.version.outputs.VERSION }}
58+
59+
- name: List release artifacts
60+
run: |
61+
echo "Contents of releases/ directory:"
62+
ls -lh releases/
63+
64+
- name: Delete existing release if exists
65+
run: |
66+
gh release delete ${{ steps.version.outputs.VERSION }} -y || true
67+
env:
68+
GH_TOKEN: ${{ github.token }}
69+
70+
- name: Create GitHub release
71+
run: |
72+
gh release create ${{ steps.version.outputs.VERSION }} \
73+
./releases/* \
74+
--title "${{ steps.version.outputs.VERSION }}" \
75+
--notes "Release ${{ steps.version.outputs.VERSION }}"
76+
env:
77+
GH_TOKEN: ${{ github.token }}
78+
79+
- name: Upload release artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: binaries-${{ steps.version.outputs.VERSION }}
83+
path: releases/*
84+
retention-days: 90

β€Ž.gitignoreβ€Ž

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Binaries
2+
binaries/
3+
releases/
4+
*.exe
5+
*.dll
6+
*.so
7+
*.dylib
8+
anime
9+
10+
# Test binary
11+
*.test
12+
13+
# Output
14+
*.out
15+
16+
# Go workspace
17+
go.work
18+
go.work.sum
19+
20+
# IDE
21+
.idea/
22+
.vscode/
23+
*.swp
24+
*.swo
25+
*~
26+
27+
# OS
28+
.DS_Store
29+
Thumbs.db
30+
31+
# Docker volumes
32+
rootfs/
33+
34+
# Config and data
35+
*.db
36+
*.log
37+
config/
38+
data/
39+
logs/
40+
41+
# Temporary
42+
/tmp/
43+
*.tmp

0 commit comments

Comments
Β (0)