Compare commits
24
Commits
eac398a73e
..
v1.0.3
@@ -9,6 +9,10 @@ jobs:
|
|||||||
release-and-publish:
|
release-and-publish:
|
||||||
name: Build, Publish Packages (Stable) & Create Release
|
name: Build, Publish Packages (Stable) & Create Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
CARGO_BINSTALL_VERSION: "1.23.0"
|
||||||
|
CARGO_DEB_VERSION: "3.8.0"
|
||||||
|
CARGO_GENERATE_RPM_VERSION: "0.21.0"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -19,18 +23,58 @@ jobs:
|
|||||||
toolchain: stable
|
toolchain: stable
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Install Cross-Compilation Toolchains & Dependencies
|
- name: Cache Cargo-Abhängigkeiten & Build-Artefakte
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Alte Paketierungs-Ausgaben aus dem Cache entfernen
|
||||||
|
run: rm -rf target/debian target/generate-rpm target/arch
|
||||||
|
|
||||||
|
- name: Install Cross-Compilation Toolchains (apt)
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-i686-linux-gnu
|
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-i686-linux-gnu
|
||||||
rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu i686-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Install Packaging Tools (Prebuilt Binaries)
|
- name: Ermittle Rust-Version für Rustup-Target-Cache-Key
|
||||||
|
run: echo "RUST_VERSION=$(rustc --version | awk '{print $2}')" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Cache Rustup Cross-Compilation-Targets
|
||||||
|
id: cache-rustup-targets
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu
|
||||||
|
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu
|
||||||
|
key: rustup-targets-${{ runner.os }}-${{ env.RUST_VERSION }}
|
||||||
|
|
||||||
|
- name: Add Rust Cross-Compilation Targets
|
||||||
|
if: steps.cache-rustup-targets.outputs.cache-hit != 'true'
|
||||||
|
run: rustup target add aarch64-unknown-linux-gnu i686-unknown-linux-gnu
|
||||||
|
|
||||||
|
- name: PATH um Cargo-bin-Verzeichnis ergänzen
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.cargo/bin
|
mkdir -p ~/.cargo/bin
|
||||||
curl -fsSL https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | tar -xz -C ~/.cargo/bin
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
||||||
~/.cargo/bin/cargo-binstall -y --no-symlinks cargo-deb cargo-generate-rpm
|
- name: Cache Packaging-Tools (cargo-binstall, cargo-deb, cargo-generate-rpm)
|
||||||
|
id: cache-packaging-tools
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.cargo/bin
|
||||||
|
key: packaging-tools-${{ runner.os }}-${{ env.CARGO_BINSTALL_VERSION }}-${{ env.CARGO_DEB_VERSION }}-${{ env.CARGO_GENERATE_RPM_VERSION }}
|
||||||
|
|
||||||
|
- name: Install Packaging Tools (Prebuilt Binaries)
|
||||||
|
if: steps.cache-packaging-tools.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
curl -fsSL "https://github.com/cargo-bins/cargo-binstall/releases/download/v${CARGO_BINSTALL_VERSION}/cargo-binstall-x86_64-unknown-linux-musl.tgz" | tar -xz -C ~/.cargo/bin
|
||||||
|
~/.cargo/bin/cargo-binstall -y --no-symlinks "cargo-deb@${CARGO_DEB_VERSION}" "cargo-generate-rpm@${CARGO_GENERATE_RPM_VERSION}"
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
renovate:
|
renovate:
|
||||||
name: Dependency-Updates prüfen & Pull Requests erstellen
|
name: Dependency-Updates prüfen & Pull Requests erstellen
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: ghcr.io/renovatebot/renovate:43.279.0
|
container: ghcr.io/renovatebot/renovate:44.79.2
|
||||||
steps:
|
steps:
|
||||||
- name: Renovate ausführen
|
- name: Renovate ausführen
|
||||||
run: renovate
|
run: renovate
|
||||||
|
|||||||
@@ -15,26 +15,69 @@ jobs:
|
|||||||
security-scan:
|
security-scan:
|
||||||
name: Trivy & OSV-Scanner
|
name: Trivy & OSV-Scanner
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TRIVY_VERSION: "0.74.0"
|
||||||
|
OSV_SCANNER_VERSION: "2.5.1"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Run Trivy Scanner
|
- name: Lokales bin-Verzeichnis zum PATH hinzufügen
|
||||||
uses: aquasecurity/trivy-action@v0.36.0
|
run: |
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
|
- name: Cache Trivy-Binary
|
||||||
|
id: cache-trivy
|
||||||
|
uses: actions/cache@v6
|
||||||
with:
|
with:
|
||||||
scan-type: fs
|
path: ~/.local/bin/trivy
|
||||||
scan-ref: .
|
key: trivy-bin-${{ runner.os }}-${{ env.TRIVY_VERSION }}
|
||||||
scanners: vuln,secret,misconfig
|
|
||||||
severity: CRITICAL,HIGH
|
- name: Install Trivy
|
||||||
format: json
|
if: steps.cache-trivy.outputs.cache-hit != 'true'
|
||||||
output: trivy-results.json
|
run: |
|
||||||
exit-code: "0"
|
curl -fsSL -o trivy.tar.gz \
|
||||||
|
"https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz"
|
||||||
|
tar -xzf trivy.tar.gz trivy
|
||||||
|
chmod +x trivy
|
||||||
|
mv trivy "$HOME/.local/bin/trivy"
|
||||||
|
rm -f trivy.tar.gz
|
||||||
|
|
||||||
|
- name: Ermittle Cache-Datum für Trivy-DB
|
||||||
|
run: echo "CACHE_DATE=$(date -u +%Y-%m-%d)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Cache Trivy-Schwachstellen-Datenbank
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.cache/trivy
|
||||||
|
key: trivy-db-${{ runner.os }}-${{ env.CACHE_DATE }}
|
||||||
|
restore-keys: |
|
||||||
|
trivy-db-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Run Trivy Scanner
|
||||||
|
run: |
|
||||||
|
trivy fs \
|
||||||
|
--scanners vuln,secret,misconfig \
|
||||||
|
--severity CRITICAL,HIGH \
|
||||||
|
--format json \
|
||||||
|
--output trivy-results.json \
|
||||||
|
--exit-code 0 \
|
||||||
|
.
|
||||||
|
|
||||||
|
- name: Cache OSV-Scanner-Binary
|
||||||
|
id: cache-osv-scanner
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.local/bin/osv-scanner
|
||||||
|
key: osv-scanner-bin-${{ runner.os }}-${{ env.OSV_SCANNER_VERSION }}
|
||||||
|
|
||||||
- name: Install OSV-Scanner
|
- name: Install OSV-Scanner
|
||||||
|
if: steps.cache-osv-scanner.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL -o /usr/local/bin/osv-scanner \
|
curl -fsSL -o "$HOME/.local/bin/osv-scanner" \
|
||||||
"https://github.com/google/osv-scanner/releases/download/v2.5.1/osv-scanner_linux_amd64"
|
"https://github.com/google/osv-scanner/releases/download/v${OSV_SCANNER_VERSION}/osv-scanner_linux_amd64"
|
||||||
chmod +x /usr/local/bin/osv-scanner
|
chmod +x "$HOME/.local/bin/osv-scanner"
|
||||||
|
|
||||||
- name: Run OSV-Scanner
|
- name: Run OSV-Scanner
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ jobs:
|
|||||||
build-and-publish:
|
build-and-publish:
|
||||||
name: Build, Publish Packages (Testing) & Create Preview Release
|
name: Build, Publish Packages (Testing) & Create Preview Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
CARGO_BINSTALL_VERSION: "1.23.0"
|
||||||
|
CARGO_DEB_VERSION: "3.8.0"
|
||||||
|
CARGO_GENERATE_RPM_VERSION: "0.21.0"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -19,18 +23,58 @@ jobs:
|
|||||||
toolchain: stable
|
toolchain: stable
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Install Cross-Compilation Toolchains & Dependencies
|
- name: Cache Cargo-Abhängigkeiten & Build-Artefakte
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Alte Paketierungs-Ausgaben aus dem Cache entfernen
|
||||||
|
run: rm -rf target/debian target/generate-rpm target/arch
|
||||||
|
|
||||||
|
- name: Install Cross-Compilation Toolchains (apt)
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-i686-linux-gnu
|
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-i686-linux-gnu
|
||||||
rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu i686-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Install Packaging Tools (Prebuilt Binaries)
|
- name: Ermittle Rust-Version für Rustup-Target-Cache-Key
|
||||||
|
run: echo "RUST_VERSION=$(rustc --version | awk '{print $2}')" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Cache Rustup Cross-Compilation-Targets
|
||||||
|
id: cache-rustup-targets
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu
|
||||||
|
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu
|
||||||
|
key: rustup-targets-${{ runner.os }}-${{ env.RUST_VERSION }}
|
||||||
|
|
||||||
|
- name: Add Rust Cross-Compilation Targets
|
||||||
|
if: steps.cache-rustup-targets.outputs.cache-hit != 'true'
|
||||||
|
run: rustup target add aarch64-unknown-linux-gnu i686-unknown-linux-gnu
|
||||||
|
|
||||||
|
- name: PATH um Cargo-bin-Verzeichnis ergänzen
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.cargo/bin
|
mkdir -p ~/.cargo/bin
|
||||||
curl -fsSL https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | tar -xz -C ~/.cargo/bin
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
||||||
~/.cargo/bin/cargo-binstall -y --no-symlinks cargo-deb cargo-generate-rpm
|
- name: Cache Packaging-Tools (cargo-binstall, cargo-deb, cargo-generate-rpm)
|
||||||
|
id: cache-packaging-tools
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.cargo/bin
|
||||||
|
key: packaging-tools-${{ runner.os }}-${{ env.CARGO_BINSTALL_VERSION }}-${{ env.CARGO_DEB_VERSION }}-${{ env.CARGO_GENERATE_RPM_VERSION }}
|
||||||
|
|
||||||
|
- name: Install Packaging Tools (Prebuilt Binaries)
|
||||||
|
if: steps.cache-packaging-tools.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
curl -fsSL "https://github.com/cargo-bins/cargo-binstall/releases/download/v${CARGO_BINSTALL_VERSION}/cargo-binstall-x86_64-unknown-linux-musl.tgz" | tar -xz -C ~/.cargo/bin
|
||||||
|
~/.cargo/bin/cargo-binstall -y --no-symlinks "cargo-deb@${CARGO_DEB_VERSION}" "cargo-generate-rpm@${CARGO_GENERATE_RPM_VERSION}"
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -4,26 +4,41 @@ on:
|
|||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 5 * * 1"
|
- cron: "0 6 * * 1"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trufflehog-scan:
|
trufflehog-scan:
|
||||||
name: TruffleHog
|
name: TruffleHog
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TRUFFLEHOG_VERSION: "3.97.4"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Lokales bin-Verzeichnis zum PATH hinzufügen
|
||||||
|
run: |
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
|
- name: Cache TruffleHog-Binary
|
||||||
|
id: cache-trufflehog
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.local/bin/trufflehog
|
||||||
|
key: trufflehog-bin-${{ runner.os }}-${{ env.TRUFFLEHOG_VERSION }}
|
||||||
|
|
||||||
- name: Install TruffleHog
|
- name: Install TruffleHog
|
||||||
|
if: steps.cache-trufflehog.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL -o trufflehog.tar.gz \
|
curl -fsSL -o trufflehog.tar.gz \
|
||||||
"https://github.com/trufflesecurity/trufflehog/releases/download/v3.97.4/trufflehog_3.97.4_linux_amd64.tar.gz"
|
"https://github.com/trufflesecurity/trufflehog/releases/download/v${TRUFFLEHOG_VERSION}/trufflehog_${TRUFFLEHOG_VERSION}_linux_amd64.tar.gz"
|
||||||
tar -xzf trufflehog.tar.gz trufflehog
|
tar -xzf trufflehog.tar.gz trufflehog
|
||||||
chmod +x trufflehog
|
chmod +x trufflehog
|
||||||
sudo mv trufflehog /usr/local/bin/trufflehog
|
mv trufflehog "$HOME/.local/bin/trufflehog"
|
||||||
rm trufflehog.tar.gz
|
rm trufflehog.tar.gz
|
||||||
|
|
||||||
- name: Run TruffleHog Scanner
|
- name: Run TruffleHog Scanner
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
name: Unit-Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
branches:
|
||||||
|
- testing
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Unit-Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Install Rust Toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Cache Cargo-Abhängigkeiten & Build-Artefakte
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: cargo test
|
||||||
Generated
+1
-1
@@ -866,7 +866,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mirror-package"
|
name = "mirror-package"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "mirror-package"
|
name = "mirror-package"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ['DragonSlayer_14']
|
authors = ['DragonSlayer_14']
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
[](https://gitea.creative-dragonslayer.de/Linuxapps/MirrorPackage/actions?workflow=main.yaml)
|
||||||
|
[](https://gitea.creative-dragonslayer.de/Linuxapps/MirrorPackage/actions?workflow=testing.yaml)
|
||||||
|
|
||||||
# mirror-package
|
# mirror-package
|
||||||
|
|
||||||
Automatisiertes Werkzeug zum Extrahieren, Herunterladen und Spiegeln vorkompilierter Linux-Pakete aus GitHub-Releases in eine selbstgehostete Gitea- / Forgejo-Paket-Registry.
|
Automatisiertes Werkzeug zum Extrahieren, Herunterladen und Spiegeln vorkompilierter Linux-Pakete aus GitHub-Releases in eine selbstgehostete Gitea- / Forgejo-Paket-Registry.
|
||||||
|
|||||||
+74
-3
@@ -3,14 +3,85 @@
|
|||||||
"extends": ["config:recommended"],
|
"extends": ["config:recommended"],
|
||||||
"timezone": "Europe/Berlin",
|
"timezone": "Europe/Berlin",
|
||||||
"schedule": ["before 6am on monday"],
|
"schedule": ["before 6am on monday"],
|
||||||
|
"baseBranches": ["dev"],
|
||||||
"packageRules": [
|
"packageRules": [
|
||||||
{
|
{
|
||||||
"matchManagers": ["github-actions"],
|
"matchFileNames": [".gitea/workflows/**"],
|
||||||
"groupName": "Gitea Actions"
|
"groupName": "Gitea Actions",
|
||||||
|
"separateMajorMinor": false,
|
||||||
|
"separateMinorPatch": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matchManagers": ["cargo"],
|
||||||
|
"groupName": "Cargo Dependencies",
|
||||||
|
"separateMajorMinor": false,
|
||||||
|
"separateMinorPatch": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"matchManagers": ["dockerfile", "docker-compose"],
|
"matchManagers": ["dockerfile", "docker-compose"],
|
||||||
"groupName": "Docker-Images"
|
"groupName": "Docker-Images",
|
||||||
|
"separateMajorMinor": false,
|
||||||
|
"separateMinorPatch": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"customManagers": [
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": ["^\\.gitea/workflows/.+\\.ya?ml$"],
|
||||||
|
"matchStrings": [
|
||||||
|
"TRIVY_VERSION:\\s*\"(?<currentValue>[^\"]+)\""
|
||||||
|
],
|
||||||
|
"depNameTemplate": "aquasecurity/trivy",
|
||||||
|
"datasourceTemplate": "github-releases",
|
||||||
|
"extractVersionTemplate": "^v(?<version>.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": ["^\\.gitea/workflows/.+\\.ya?ml$"],
|
||||||
|
"matchStrings": [
|
||||||
|
"OSV_SCANNER_VERSION:\\s*\"(?<currentValue>[^\"]+)\""
|
||||||
|
],
|
||||||
|
"depNameTemplate": "google/osv-scanner",
|
||||||
|
"datasourceTemplate": "github-releases",
|
||||||
|
"extractVersionTemplate": "^v(?<version>.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": ["^\\.gitea/workflows/.+\\.ya?ml$"],
|
||||||
|
"matchStrings": [
|
||||||
|
"TRUFFLEHOG_VERSION:\\s*\"(?<currentValue>[^\"]+)\""
|
||||||
|
],
|
||||||
|
"depNameTemplate": "trufflesecurity/trufflehog",
|
||||||
|
"datasourceTemplate": "github-releases",
|
||||||
|
"extractVersionTemplate": "^v(?<version>.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": ["^\\.gitea/workflows/.+\\.ya?ml$"],
|
||||||
|
"matchStrings": [
|
||||||
|
"CARGO_BINSTALL_VERSION:\\s*\"(?<currentValue>[^\"]+)\""
|
||||||
|
],
|
||||||
|
"depNameTemplate": "cargo-bins/cargo-binstall",
|
||||||
|
"datasourceTemplate": "github-releases",
|
||||||
|
"extractVersionTemplate": "^v(?<version>.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": ["^\\.gitea/workflows/.+\\.ya?ml$"],
|
||||||
|
"matchStrings": [
|
||||||
|
"CARGO_DEB_VERSION:\\s*\"(?<currentValue>[^\"]+)\""
|
||||||
|
],
|
||||||
|
"depNameTemplate": "cargo-deb",
|
||||||
|
"datasourceTemplate": "crate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": ["^\\.gitea/workflows/.+\\.ya?ml$"],
|
||||||
|
"matchStrings": [
|
||||||
|
"CARGO_GENERATE_RPM_VERSION:\\s*\"(?<currentValue>[^\"]+)\""
|
||||||
|
],
|
||||||
|
"depNameTemplate": "cargo-generate-rpm",
|
||||||
|
"datasourceTemplate": "crate"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-10
@@ -9,9 +9,14 @@ import os
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import urllib.error
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
|
# Paket-Typen, unter denen dasselbe Release veroeffentlicht wird und die sich
|
||||||
|
# daher eine gemeinsame Build-Nummer teilen muessen.
|
||||||
|
PACKAGE_TYPES = ("debian", "rpm", "arch")
|
||||||
|
|
||||||
|
|
||||||
def get_cargo_pkg_info():
|
def get_cargo_pkg_info():
|
||||||
try:
|
try:
|
||||||
@@ -83,20 +88,29 @@ def query_existing_build_numbers(name, version, gitea_url, repo, owner, token=No
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
sys.stderr.write(f"[Hinweis] Konnte Gitea Releases nicht abfragen: {e}\n")
|
sys.stderr.write(f"[Hinweis] Konnte Gitea Releases nicht abfragen: {e}\n")
|
||||||
|
|
||||||
# 2. Gitea Packages API (falls Token vorhanden)
|
# 2. Gitea Packages API (falls Token vorhanden): pro Paket-Typ gezielt nur die
|
||||||
if gitea_url and owner and token:
|
# neueste Version abfragen (ein Request, keine Pagination noetig). Das haelt
|
||||||
try:
|
# die Abfrage schnell unabhaengig von der Historie und ist unbeeinflusst von
|
||||||
url = f"{gitea_url.rstrip('/')}/api/v1/packages/{owner}?limit=50"
|
# Docker-Tags/anderen Paket-Typen, die unter demselben Owner haengen.
|
||||||
req = urllib.request.Request(url, headers=headers)
|
if gitea_url and owner and token and name:
|
||||||
with urllib.request.urlopen(req, timeout=10) as resp:
|
for pkg_type in PACKAGE_TYPES:
|
||||||
packages = json.loads(resp.read().decode())
|
try:
|
||||||
for pkg in packages:
|
url = (
|
||||||
|
f"{gitea_url.rstrip('/')}/api/v1/packages/{owner}/"
|
||||||
|
f"{pkg_type}/{urllib.parse.quote(name, safe='')}/-/latest"
|
||||||
|
)
|
||||||
|
req = urllib.request.Request(url, headers=headers)
|
||||||
|
with urllib.request.urlopen(req, timeout=10) as resp:
|
||||||
|
pkg = json.loads(resp.read().decode())
|
||||||
pkg_ver = pkg.get("version", "")
|
pkg_ver = pkg.get("version", "")
|
||||||
m = pattern.search(pkg_ver)
|
m = pattern.search(pkg_ver)
|
||||||
if m:
|
if m:
|
||||||
build_nums.add(int(m.group(1)))
|
build_nums.add(int(m.group(1)))
|
||||||
except Exception as e:
|
except urllib.error.HTTPError as e:
|
||||||
sys.stderr.write(f"[Hinweis] Konnte Gitea Packages nicht abfragen: {e}\n")
|
if e.code != 404:
|
||||||
|
sys.stderr.write(f"[Hinweis] Konnte neueste {pkg_type}-Paketversion nicht abfragen: {e}\n")
|
||||||
|
except Exception as e:
|
||||||
|
sys.stderr.write(f"[Hinweis] Konnte neueste {pkg_type}-Paketversion nicht abfragen: {e}\n")
|
||||||
|
|
||||||
# 3. Lokales Target-Verzeichnis prüfen
|
# 3. Lokales Target-Verzeichnis prüfen
|
||||||
target_dirs = ["target/debian", "target/generate-rpm", "target/arch"]
|
target_dirs = ["target/debian", "target/generate-rpm", "target/arch"]
|
||||||
|
|||||||
Reference in New Issue
Block a user