Package for public GitHub release
Add open-source scaffolding and CI; remove Claude-specific dev notes from the published tree. - Remove CLAUDE.md from tracking (kept locally, now git-ignored). - CHANGELOG.md (Keep a Changelog; v1.0 → v1.1.1). - SECURITY.md (private vuln reporting + operator guidance). - CONTRIBUTING.md (dev setup, conventions, PR flow). - .github/: bug + feature issue templates, PR template. - .github/workflows/ci.yml: byte-compile, validate example config, docker build. - .github/workflows/release.yml: on a version tag, publish a multi-arch (amd64 + arm64) image to GHCR. - README: license/release/CI badges, prebuilt-image (GHCR) run instructions, and a corrected Python-version note (3.9–3.11; netifaces caveat). Badges and image names use an `OWNER` placeholder to replace with the GitHub namespace after the repo is created. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
python:
|
||||
name: Python checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
- name: Byte-compile server
|
||||
run: python -m compileall -q server.py
|
||||
- name: Validate example config is valid JSON
|
||||
run: python -c "import json; json.load(open('config.json.example'))"
|
||||
|
||||
docker:
|
||||
name: Docker build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build image
|
||||
run: docker build -t ads-bit:ci .
|
||||
@@ -0,0 +1,52 @@
|
||||
name: Release
|
||||
|
||||
# Build and publish a multi-arch image to GitHub Container Registry (GHCR)
|
||||
# whenever a version tag is pushed (e.g. v1.1.2). Lets users run a prebuilt
|
||||
# image — including on Raspberry Pi (arm64) — without building locally.
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Compute lowercase image name
|
||||
id: img
|
||||
run: echo "name=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Docker metadata (tags & labels)
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ steps.img.outputs.name }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=raw,value=latest
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
Reference in New Issue
Block a user