Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 06b1797537 | |||
| 0fd817b13f | |||
| c7eddffbb3 | |||
| 17e0fadd44 | |||
| cfd1972d54 | |||
| 8cbd495004 | |||
| e04f19ed03 | |||
| ff054f42bb | |||
| 818a48fa78 | |||
| 111ea50d80 | |||
| 1b46845734 | |||
| 497b99c328 | |||
| 6b070d8c14 | |||
| dff743a00b | |||
| f408d3d705 | |||
| c4c018b1ee | |||
| b18e34c905 |
@@ -1,59 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-8:
|
||||
runs-on: almalinux-8
|
||||
container:
|
||||
image: git.unkin.net/unkin/almalinux8-actionsdind:latest
|
||||
options: "--privileged --volume /etc/pki/tls/vault:/etc/pki/tls/vault:ro"
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Packages
|
||||
env:
|
||||
VAULT_ROLE_ID: ${{ secrets.RPMBUILDER_VAULT_ROLEID }}
|
||||
run: |
|
||||
./tools/build build-all --distro almalinux/el8
|
||||
|
||||
- name: Show RPMs
|
||||
run: |
|
||||
find /workspace -type f -name "*.rpm"
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rpms-8
|
||||
path: /workspace/unkin/rpmbuilder/dist/*/*/*.rpm
|
||||
|
||||
build-9:
|
||||
runs-on: almalinux-8
|
||||
container:
|
||||
image: git.unkin.net/unkin/almalinux9-actionsdind:latest
|
||||
options: "--privileged --volume /etc/pki/tls/vault:/etc/pki/tls/vault:ro"
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Packages
|
||||
env:
|
||||
VAULT_ROLE_ID: ${{ secrets.RPMBUILDER_VAULT_ROLEID }}
|
||||
run: |
|
||||
./tools/build build-all --distro almalinux/el9
|
||||
|
||||
- name: Show RPMs
|
||||
run: |
|
||||
find /workspace -type f -name "*.rpm"
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rpms-9
|
||||
path: /workspace/unkin/rpmbuilder/dist/*/*/*.rpm
|
||||
@@ -1,66 +0,0 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-8:
|
||||
runs-on: almalinux-8
|
||||
container:
|
||||
image: git.unkin.net/unkin/almalinux8-actionsdind:latest
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download Artifacts
|
||||
run: |
|
||||
mkdir -p /workspace/unkin/rpmbuilder/dist/almalinux/el8
|
||||
export PREVIOUS_RUN_ID=$((GITHUB_RUN_NUMBER - 1))
|
||||
curl -L -o /workspace/rpms.zip "https://git.unkin.net/${GITHUB_REPOSITORY}/actions/runs/${PREVIOUS_RUN_ID}/artifacts/rpms-8"
|
||||
unzip /workspace/rpms.zip -d /workspace/unkin/rpmbuilder/dist/almalinux/el8
|
||||
|
||||
- name: Show RPMs
|
||||
run: |
|
||||
find /workspace -type f -name "*.rpm"
|
||||
|
||||
- name: Upload RPMs to Gitea
|
||||
env:
|
||||
DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }}
|
||||
run: |
|
||||
for rpm in $(find /workspace/unkin/rpmbuilder/dist/almalinux/el8 -type f -name "*.rpm"); do
|
||||
curl --user droneci:${{ secrets.DRONECI_PASSWORD }} --upload-file $rpm https://git.unkin.net/api/packages/unkin/rpm/almalinux/el8/upload
|
||||
done
|
||||
|
||||
deploy-9:
|
||||
runs-on: almalinux-8
|
||||
container:
|
||||
image: git.unkin.net/unkin/almalinux9-actionsdind:latest
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download Artifacts
|
||||
run: |
|
||||
mkdir -p /workspace/unkin/rpmbuilder/dist/almalinux/el9
|
||||
export PREVIOUS_RUN_ID=$((GITHUB_RUN_NUMBER - 1))
|
||||
curl -L -o /workspace/rpms.zip "https://git.unkin.net/${GITHUB_REPOSITORY}/actions/runs/${PREVIOUS_RUN_ID}/artifacts/rpms-9"
|
||||
unzip /workspace/rpms.zip -d /workspace/unkin/rpmbuilder/dist/almalinux/el9
|
||||
|
||||
- name: Show RPMs
|
||||
run: |
|
||||
find /workspace -type f -name "*.rpm"
|
||||
|
||||
- name: Upload RPMs to Gitea
|
||||
env:
|
||||
DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }}
|
||||
run: |
|
||||
for rpm in $(find /workspace/unkin/rpmbuilder/dist/almalinux/el9 -type f -name "*.rpm"); do
|
||||
curl --user droneci:${{ secrets.DRONECI_PASSWORD }} --upload-file $rpm https://git.unkin.net/api/packages/unkin/rpm/almalinux/el9/upload
|
||||
done
|
||||
+16
-3
@@ -3,12 +3,24 @@ repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-json
|
||||
- id: check-added-large-files
|
||||
args: ['--maxkb=500']
|
||||
- id: check-merge-conflict
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: check-symlinks
|
||||
- id: check-toml
|
||||
- id: check-yaml
|
||||
args: [--allow-multiple-documents]
|
||||
- id: check-merge-conflict
|
||||
- id: detect-aws-credentials
|
||||
args: [--allow-missing-credentials]
|
||||
- id: detect-private-key
|
||||
- id: end-of-file-fixer
|
||||
- id: forbid-new-submodules
|
||||
- id: pretty-format-json
|
||||
- id: trailing-whitespace
|
||||
|
||||
- repo: https://github.com/adrienverge/yamllint.git
|
||||
rev: v1.37.1
|
||||
hooks:
|
||||
@@ -18,6 +30,7 @@ repos:
|
||||
"-d {extends: relaxed, rules: {line-length: disable}}",
|
||||
"-s",
|
||||
]
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.14.7
|
||||
hooks:
|
||||
|
||||
@@ -5,17 +5,16 @@ steps:
|
||||
- name: build rpms
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
commands:
|
||||
- mkdir -p /app/dist
|
||||
- mkdir -p /woodpecker/rpms
|
||||
- ln -s /woodpecker/rpms /workspace
|
||||
- dnf install buildah -y
|
||||
- ./tools/build build-all --distro almalinux/el8 --buildah
|
||||
environment:
|
||||
BUILDAH_ISOLATION: chroot
|
||||
volumes:
|
||||
- /dev/fuse:/dev/fuse
|
||||
privileged: true
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
|
||||
- name: show rpms
|
||||
image: git.unkin.net/unkin/almalinux8-base:latest
|
||||
commands:
|
||||
- find /app/dist -type f -name "*.rpm"
|
||||
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
|
||||
|
||||
@@ -5,17 +5,16 @@ steps:
|
||||
- name: build rpms
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
commands:
|
||||
- mkdir -p /app/dist/
|
||||
- mkdir -p /woodpecker/rpms
|
||||
- ln -s /woodpecker/rpms /workspace
|
||||
- dnf install buildah -y
|
||||
- ./tools/build build-all --distro almalinux/el9 --buildah
|
||||
environment:
|
||||
BUILDAH_ISOLATION: chroot
|
||||
volumes:
|
||||
- /dev/fuse:/dev/fuse
|
||||
privileged: true
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
|
||||
- name: show rpms
|
||||
image: git.unkin.net/unkin/almalinux9-base:latest
|
||||
commands:
|
||||
- find /app/dist -type f -name "*.rpm"
|
||||
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
when:
|
||||
- event: push
|
||||
branch: master
|
||||
|
||||
steps:
|
||||
- name: build-rpms
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
commands:
|
||||
- mkdir -p /woodpecker/rpms
|
||||
- ln -s /woodpecker/rpms /workspace
|
||||
- dnf install buildah -y
|
||||
- ./tools/build build-all --distro almalinux/el8 --buildah
|
||||
privileged: true
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
|
||||
- name: show-rpms
|
||||
image: git.unkin.net/unkin/almalinux9-base:latest
|
||||
commands:
|
||||
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
|
||||
depends_on: [build-rpms]
|
||||
|
||||
- name: deploy-rpms
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
commands:
|
||||
- |
|
||||
for rpm in $(find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"); do
|
||||
curl --user droneci:$${DRONECI_PASSWORD} --upload-file $rpm https://git.unkin.net/api/packages/unkin/rpm/almalinux/el8/upload
|
||||
done
|
||||
environment:
|
||||
DRONECI_PASSWORD:
|
||||
from_secret: DRONECI_PASSWORD
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
depends_on: [build-rpms, show-rpms]
|
||||
@@ -0,0 +1,37 @@
|
||||
when:
|
||||
- event: push
|
||||
branch: master
|
||||
|
||||
steps:
|
||||
- name: build-rpms
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
commands:
|
||||
- mkdir -p /woodpecker/rpms
|
||||
- ln -s /woodpecker/rpms /workspace
|
||||
- dnf install buildah -y
|
||||
- ./tools/build build-all --distro almalinux/el9 --buildah
|
||||
privileged: true
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
|
||||
- name: show-rpms
|
||||
image: git.unkin.net/unkin/almalinux9-base:latest
|
||||
commands:
|
||||
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
|
||||
depends_on: [build-rpms]
|
||||
|
||||
- name: deploy-rpms
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
commands:
|
||||
- |
|
||||
for rpm in $(find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"); do
|
||||
curl --user droneci:$${DRONECI_PASSWORD} --upload-file $rpm https://git.unkin.net/api/packages/unkin/rpm/almalinux/el9/upload
|
||||
done
|
||||
environment:
|
||||
DRONECI_PASSWORD:
|
||||
from_secret: DRONECI_PASSWORD
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
depends_on: [build-rpms, show-rpms]
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
arch: amd64
|
||||
builds:
|
||||
- image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest
|
||||
release: '1'
|
||||
repository: [almalinux/el8]
|
||||
version: 2.1.120
|
||||
- image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
release: '1'
|
||||
repository: [almalinux/el9]
|
||||
version: 2.1.120
|
||||
claude_ai: true
|
||||
description: Claude Code - Anthropic's agentic AI coding tool
|
||||
homepage: https://claude.ai/code
|
||||
license: Proprietary
|
||||
maintainer: Anthropic
|
||||
name: claude-code
|
||||
platform: linux
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Download claude-code binary
|
||||
wget -O /app/claude https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/claude-ai/claude-code-releases/${PACKAGE_VERSION}/linux-x64/claude
|
||||
chmod +x /app/claude
|
||||
|
||||
# Process the nfpm.yaml template with environment variables
|
||||
envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml
|
||||
|
||||
# Build the RPM
|
||||
nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm
|
||||
@@ -0,0 +1,33 @@
|
||||
# nfpm.yaml
|
||||
|
||||
name: ${PACKAGE_NAME}
|
||||
version: ${PACKAGE_VERSION}
|
||||
release: ${PACKAGE_RELEASE}
|
||||
arch: ${PACKAGE_ARCH}
|
||||
platform: ${PACKAGE_PLATFORM}
|
||||
section: default
|
||||
priority: extra
|
||||
description: "${PACKAGE_DESCRIPTION}"
|
||||
|
||||
maintainer: ${PACKAGE_MAINTAINER}
|
||||
homepage: ${PACKAGE_HOMEPAGE}
|
||||
license: ${PACKAGE_LICENSE}
|
||||
|
||||
disable_globbing: false
|
||||
|
||||
replaces:
|
||||
- claude-code
|
||||
- claude
|
||||
|
||||
provides:
|
||||
- claude-code
|
||||
- claude
|
||||
|
||||
# Files to include in the package
|
||||
contents:
|
||||
- src: /app/claude
|
||||
dst: /usr/bin/claude
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: stern
|
||||
github: stern/stern
|
||||
description: Multi pod and container log tailing for Kubernetes.
|
||||
arch: amd64
|
||||
platform: linux
|
||||
maintainer: stern
|
||||
homepage: https://github.com/stern/stern
|
||||
license: Apache-2.0
|
||||
builds:
|
||||
- repository:
|
||||
- almalinux/el8
|
||||
image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest
|
||||
release: 1
|
||||
version: 1.33.1
|
||||
- repository:
|
||||
- almalinux/el9
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
release: 1
|
||||
version: 1.33.1
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
wget -O /app/stern_${PACKAGE_VERSION}_linux_amd64.tar.gz https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/github/stern/stern/releases/download/v${PACKAGE_VERSION}/stern_${PACKAGE_VERSION}_linux_amd64.tar.gz
|
||||
tar xf /app/stern_${PACKAGE_VERSION}_linux_amd64.tar.gz
|
||||
|
||||
envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml
|
||||
|
||||
nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm
|
||||
@@ -0,0 +1,30 @@
|
||||
# nfpm.yaml
|
||||
|
||||
name: ${PACKAGE_NAME}
|
||||
version: ${PACKAGE_VERSION}
|
||||
release: ${PACKAGE_RELEASE}
|
||||
arch: ${PACKAGE_ARCH}
|
||||
platform: ${PACKAGE_PLATFORM}
|
||||
section: default
|
||||
priority: extra
|
||||
description: "${PACKAGE_DESCRIPTION}"
|
||||
|
||||
maintainer: ${PACKAGE_MAINTAINER}
|
||||
homepage: ${PACKAGE_HOMEPAGE}
|
||||
license: ${PACKAGE_LICENSE}
|
||||
|
||||
disable_globbing: false
|
||||
|
||||
replaces:
|
||||
- stern
|
||||
|
||||
provides:
|
||||
- stern
|
||||
|
||||
contents:
|
||||
- src: /app/stern
|
||||
dst: /usr/bin/stern
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: tea
|
||||
github: unknown/tea
|
||||
description: The official CLI for Gitea.
|
||||
arch: amd64
|
||||
platform: linux
|
||||
maintainer: Gitea
|
||||
homepage: https://gitea.com/gitea/tea
|
||||
license: MIT
|
||||
builds:
|
||||
- repository:
|
||||
- almalinux/el8
|
||||
image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest
|
||||
release: 1
|
||||
version: 0.14.0
|
||||
- repository:
|
||||
- almalinux/el9
|
||||
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
|
||||
release: 1
|
||||
version: 0.14.0
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
curl -L --output /app/tea-linux-amd64 https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/gitea-dl/tea/${PACKAGE_VERSION}/tea-${PACKAGE_VERSION}-linux-amd64
|
||||
chmod +x /app/tea-linux-amd64
|
||||
|
||||
envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml
|
||||
|
||||
nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm
|
||||
@@ -0,0 +1,30 @@
|
||||
# nfpm.yaml
|
||||
|
||||
name: ${PACKAGE_NAME}
|
||||
version: ${PACKAGE_VERSION}
|
||||
release: ${PACKAGE_RELEASE}
|
||||
arch: ${PACKAGE_ARCH}
|
||||
platform: ${PACKAGE_PLATFORM}
|
||||
section: default
|
||||
priority: extra
|
||||
description: "${PACKAGE_DESCRIPTION}"
|
||||
|
||||
maintainer: ${PACKAGE_MAINTAINER}
|
||||
homepage: ${PACKAGE_HOMEPAGE}
|
||||
license: ${PACKAGE_LICENSE}
|
||||
|
||||
disable_globbing: false
|
||||
|
||||
replaces:
|
||||
- tea
|
||||
|
||||
provides:
|
||||
- tea
|
||||
|
||||
contents:
|
||||
- src: /app/tea-linux-amd64
|
||||
dst: /usr/bin/tea
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
Regular → Executable
+33
-8
@@ -769,6 +769,7 @@ def build_package_docker(
|
||||
build_args = [
|
||||
'docker', 'build',
|
||||
'--pull',
|
||||
'--network=host',
|
||||
'-f', str(central_dockerfile),
|
||||
'--build-arg', f'BASE_IMAGE={base_image}',
|
||||
'--build-arg', f'PACKAGE_NAME={package_name}',
|
||||
@@ -801,6 +802,7 @@ def build_package_docker(
|
||||
# Step 2: Create and start container
|
||||
create_args = [
|
||||
'docker', 'create',
|
||||
'--network=host',
|
||||
'--name', container_name,
|
||||
image_name
|
||||
]
|
||||
@@ -1102,18 +1104,37 @@ def build_package_buildah(
|
||||
'find', '/app/dist', '-type', 'f', '-name', '*.rpm'
|
||||
]
|
||||
result = subprocess.run(copy_out_args, capture_output=True, text=True)
|
||||
logger.debug(f"Find RPMs result: {result.stdout}")
|
||||
|
||||
if result.returncode == 0 and result.stdout.strip():
|
||||
rpm_files = result.stdout.strip().split('\n')
|
||||
logger.info(f"Found {len(rpm_files)} RPM files to copy")
|
||||
|
||||
for rpm_file in rpm_files:
|
||||
rpm_file = rpm_file.strip()
|
||||
if rpm_file:
|
||||
copy_args = [
|
||||
'buildah', 'copy', '--from', container_name,
|
||||
rpm_file, str(package_dist_dir)
|
||||
]
|
||||
logger.debug(f"Running: {' '.join(copy_args)}")
|
||||
subprocess.run(copy_args, capture_output=True, text=True)
|
||||
# Use buildah mount to copy files out
|
||||
mount_args = ['buildah', 'mount', container_name]
|
||||
mount_result = subprocess.run(mount_args, capture_output=True, text=True)
|
||||
|
||||
if mount_result.returncode == 0:
|
||||
container_path = mount_result.stdout.strip()
|
||||
source_file = Path(container_path) / rpm_file.lstrip('/')
|
||||
|
||||
if source_file.exists():
|
||||
import shutil
|
||||
dest_file = package_dist_dir / source_file.name
|
||||
shutil.copy2(source_file, dest_file)
|
||||
logger.debug(f"Copied {source_file} to {dest_file}")
|
||||
else:
|
||||
logger.error(f"Source file not found: {source_file}")
|
||||
|
||||
# Unmount
|
||||
subprocess.run(['buildah', 'unmount', container_name], capture_output=True)
|
||||
else:
|
||||
logger.error(f"Failed to mount container: {mount_result.stderr}")
|
||||
else:
|
||||
logger.warning(f"No RPM files found or find command failed: {result.stderr}")
|
||||
|
||||
logger.info(f"Successfully built {package_name}-{package_version}-{package_release} using Buildah")
|
||||
return True
|
||||
@@ -1436,9 +1457,13 @@ class Builder:
|
||||
return True
|
||||
|
||||
# Check build tool availability (unless dry run)
|
||||
use_native = native or (not buildah and check_native_build_deps())
|
||||
use_buildah = buildah or (not use_native and check_buildah_available())
|
||||
use_native = native
|
||||
use_buildah = buildah
|
||||
use_docker = not use_native and not use_buildah and check_docker_available()
|
||||
if not use_native and not use_buildah and not use_docker:
|
||||
use_buildah = check_buildah_available()
|
||||
if not use_native and not use_buildah and not use_docker:
|
||||
use_native = check_native_build_deps()
|
||||
|
||||
if not dry_run and not use_native and not use_buildah and not use_docker:
|
||||
self.logger.error("No build tools available (tried native, Buildah, Docker)")
|
||||
|
||||
+45
-14
@@ -154,6 +154,33 @@ def load_env_vars(env_file: Path) -> Dict[str, str]:
|
||||
return env_vars
|
||||
|
||||
|
||||
def get_claude_ai_latest_version() -> Optional[str]:
|
||||
"""
|
||||
Get the latest claude-code version from downloads.claude.ai.
|
||||
|
||||
Returns:
|
||||
Latest version string or None if not found
|
||||
"""
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
url = "https://downloads.claude.ai/claude-code-releases/latest"
|
||||
logger.debug(f"Checking claude-code latest version: {url}")
|
||||
response = requests.get(url, timeout=30)
|
||||
|
||||
if response.status_code == 200:
|
||||
version = response.text.strip()
|
||||
logger.debug(f"Latest claude-code version: {version}")
|
||||
return version
|
||||
else:
|
||||
logger.warning(f"Unexpected response from claude.ai: {response.status_code}")
|
||||
return None
|
||||
|
||||
except requests.RequestException as e:
|
||||
logger.error(f"Failed to check claude-code version: {e}")
|
||||
return None
|
||||
|
||||
|
||||
def get_github_latest_release(repo: str) -> Optional[Dict]:
|
||||
"""
|
||||
Get the latest release from GitHub API.
|
||||
@@ -315,26 +342,30 @@ def check_package_updates(package_dir: Path, dry_run: bool = False) -> bool:
|
||||
package_name = metadata.get('name', package_dir.name)
|
||||
current_version = metadata.get('version')
|
||||
github_repo = metadata.get('github')
|
||||
claude_ai = metadata.get('claude_ai', False)
|
||||
|
||||
if not github_repo:
|
||||
logger.debug(f"Package {package_name} has no GitHub repo configured")
|
||||
if not github_repo and not claude_ai:
|
||||
logger.debug(f"Package {package_name} has no GitHub repo or claude_ai configured")
|
||||
return True
|
||||
|
||||
if not current_version:
|
||||
logger.warning(f"Package {package_name} has no version in metadata")
|
||||
return False
|
||||
|
||||
logger.info(f"Checking {package_name} (current: {current_version}) from {github_repo}")
|
||||
|
||||
# Get latest release from GitHub
|
||||
latest_release = get_github_latest_release(github_repo)
|
||||
if not latest_release:
|
||||
return False
|
||||
|
||||
latest_version = normalize_version(latest_release.get('tag_name', ''))
|
||||
if not latest_version:
|
||||
logger.warning(f"Could not determine latest version for {package_name}")
|
||||
return False
|
||||
if claude_ai:
|
||||
logger.info(f"Checking {package_name} (current: {current_version}) from downloads.claude.ai")
|
||||
latest_version = get_claude_ai_latest_version()
|
||||
if not latest_version:
|
||||
return False
|
||||
else:
|
||||
logger.info(f"Checking {package_name} (current: {current_version}) from {github_repo}")
|
||||
latest_release = get_github_latest_release(github_repo)
|
||||
if not latest_release:
|
||||
return False
|
||||
latest_version = normalize_version(latest_release.get('tag_name', ''))
|
||||
if not latest_version:
|
||||
logger.warning(f"Could not determine latest version for {package_name}")
|
||||
return False
|
||||
|
||||
# Compare versions
|
||||
if compare_versions(current_version, latest_version):
|
||||
@@ -373,7 +404,7 @@ def find_packages_with_github(rpms_dir: Path) -> List[Path]:
|
||||
with open(metadata_file, 'r') as f:
|
||||
metadata = yaml.safe_load(f)
|
||||
|
||||
if metadata.get('github'):
|
||||
if metadata.get('github') or metadata.get('claude_ai'):
|
||||
github_packages.append(package_dir)
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user