mirror of
https://github.com/Dasemu/Maskarr.git
synced 2026-11-26 15:26:10 +00:00
Merge pull request 'chore: bootstrap Claude setup and fix workflows' (#2) from chore/bootstrap into main
Reviewed-on: #2
This commit is contained in:
commit
871cbd9851
5 files changed
+35
-105
No files matched your search
@@ -0,0 +1,24 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [development]
|
||||||
|
push:
|
||||||
|
branches: [development, main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
cache: "pip"
|
||||||
|
|
||||||
|
- run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
# No linter or test suite is configured for this project yet.
|
||||||
|
# This is a lightweight sanity check (syntax/import compile), not a test run.
|
||||||
|
- run: python3 -m py_compile maskarr.py
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
name: Build and Publish Docker Images
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- 'v*.*.*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Set image name
|
|
||||||
id: image
|
|
||||||
run: |
|
|
||||||
# Normalize repository name to lowercase
|
|
||||||
REPO_LOWER=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
|
|
||||||
GITEA_REGISTRY="${{ gitea.server_url }}"
|
|
||||||
|
|
||||||
# Remove https:// from server URL for registry
|
|
||||||
GITEA_HOST=$(echo "$GITEA_REGISTRY" | sed 's|https://||' | sed 's|http://||')
|
|
||||||
|
|
||||||
echo "gitea_host=${GITEA_HOST}" >> $GITHUB_OUTPUT
|
|
||||||
echo "gitea_image=${GITEA_HOST}/${REPO_LOWER}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ${{ steps.image.outputs.gitea_host }}
|
|
||||||
username: ${{ gitea.actor }}
|
|
||||||
password: ${{ secrets.AUTH_TOKEN }}
|
|
||||||
|
|
||||||
- name: Generate tags
|
|
||||||
id: tags
|
|
||||||
run: |
|
|
||||||
GITEA_IMG="${{ steps.image.outputs.gitea_image }}"
|
|
||||||
|
|
||||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
|
||||||
VERSION=${GITHUB_REF#refs/tags/v}
|
|
||||||
TAGS="${GITEA_IMG}:${VERSION},${GITEA_IMG}:latest"
|
|
||||||
else
|
|
||||||
TAGS="${GITEA_IMG}:latest"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
tags: ${{ steps.tags.outputs.tags }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.title=Maskarr
|
|
||||||
org.opencontainers.image.description=Tracker Proxy for *arr Applications
|
|
||||||
org.opencontainers.image.source=${{ gitea.server_url }}/${{ gitea.repository }}
|
|
||||||
org.opencontainers.image.revision=${{ gitea.sha }}
|
|
||||||
org.opencontainers.image.created=${{ gitea.event.repository.updated_at }}
|
|
||||||
|
|
||||||
- name: Print summary
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
run: |
|
|
||||||
echo "✅ Docker image published successfully!"
|
|
||||||
echo ""
|
|
||||||
echo "Gitea Registry:"
|
|
||||||
echo " ${{ steps.image.outputs.gitea_image }}:latest"
|
|
||||||
@@ -9,23 +9,23 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bump:
|
bump:
|
||||||
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'github-actions[bot]' }}
|
if: ${{ !contains(gitea.event.head_commit.message, '[skip ci]') && gitea.actor != 'gitea-actions' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ gitea.token }}
|
||||||
|
|
||||||
- name: Configure git identity
|
- name: Configure git identity
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "gitea-actions"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "gitea-actions@noreply.git.zenvairo.es"
|
||||||
|
|
||||||
- name: Determine bump type
|
- name: Determine bump type
|
||||||
id: bump
|
id: bump
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_name }}" = "development" ]; then
|
if [ "${{ gitea.ref_name }}" = "development" ]; then
|
||||||
echo "type=patch" >> "$GITHUB_OUTPUT"
|
echo "type=patch" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
# main: minor bump only when this push is a merge (an approved
|
# main: minor bump only when this push is a merge (an approved
|
||||||
@@ -57,10 +57,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git add VERSION
|
git add VERSION
|
||||||
git commit -m "chore(release): v${{ steps.version.outputs.new }} [skip ci]"
|
git commit -m "chore(release): v${{ steps.version.outputs.new }} [skip ci]"
|
||||||
git push origin HEAD:${{ github.ref_name }}
|
git push origin HEAD:${{ gitea.ref_name }}
|
||||||
|
|
||||||
- name: Merge main back into development
|
- name: Merge main back into development
|
||||||
if: github.ref_name == 'main'
|
if: gitea.ref_name == 'main'
|
||||||
run: |
|
run: |
|
||||||
git fetch origin development
|
git fetch origin development
|
||||||
git checkout development
|
git checkout development
|
||||||
@@ -22,7 +22,7 @@ Everything lives in `maskarr.py`: an `http.server`-based proxy that forwards req
|
|||||||
- No `development` branch exists yet; CI and the version workflow reference it per the standard shape, but they won't trigger until it's created.
|
- No `development` branch exists yet; CI and the version workflow reference it per the standard shape, but they won't trigger until it's created.
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
Docker image published to GHCR and the private Gitea registry on push to `main`/tags (`.github/workflows/docker-publish.yml`, `.gitea/workflows/docker-publish.yml`). See `docs/deployment.md` for systemd and Docker instructions.
|
Docker image published to GHCR only, on push to `main`/tags (`.github/workflows/docker-publish.yml`). Version workflow lives in `.gitea/workflows/`; CI runs in both `.gitea/workflows/` and `.github/workflows/`. See `docs/deployment.md` for systemd and Docker instructions.
|
||||||
|
|
||||||
## Gotchas
|
## Gotchas
|
||||||
- `maskarr_config.json` is tracked as an empty template; don't commit it populated with real tracker credentials/cookies.
|
- `maskarr_config.json` is tracked as an empty template; don't commit it populated with real tracker credentials/cookies.
|
||||||
|
|||||||
+3
-13
@@ -78,22 +78,12 @@ docker run -d \
|
|||||||
|
|
||||||
## CI/CD - automatic Docker image publishing
|
## CI/CD - automatic Docker image publishing
|
||||||
|
|
||||||
The project includes workflows for **GitHub Actions** and **Gitea Actions** that automatically
|
The GitHub Actions workflow `.github/workflows/docker-publish.yml` publishes the Docker image to
|
||||||
publish Docker images.
|
**GitHub Container Registry** (`ghcr.io`) on each push to `main`/`master` or tag `v*.*.*`.
|
||||||
|
CI and versioning run on Gitea Actions (`.gitea/workflows/` (CI also runs on GitHub)).
|
||||||
### Supported registries
|
|
||||||
|
|
||||||
Each push to `main`/`master` or tag `v*.*.*` will publish to:
|
|
||||||
|
|
||||||
1. **GitHub Container Registry** (`ghcr.io`) - primary and most reliable
|
|
||||||
2. **Gitea Container Registry** (your private instance)
|
|
||||||
|
|
||||||
### Using published images
|
### Using published images
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# From GitHub Container Registry (recommended)
|
|
||||||
docker pull ghcr.io/dasemu/maskarr:latest
|
docker pull ghcr.io/dasemu/maskarr:latest
|
||||||
|
|
||||||
# From Gitea
|
|
||||||
docker pull git.dariosevilla.es/dasemu/maskarr:latest
|
|
||||||
```
|
```
|
||||||
Reference in new issue
Block a user