Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
honjow committed Jan 25, 2025
1 parent 0facd2b commit b68caf2
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 20 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build-system-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,37 @@ jobs:
pattern: Packages*
merge-multiple: true
path: pkgs/
- name: Verify checksums
run: |
echo "Verifying package checksums..."
cd aur-pkgs
if ! sha256sum -c sha256sums.txt; then
echo "Error: AUR package checksum verification failed"
exit 1
fi
cd ../pkgs
if ! sha256sum -c sha256sums.txt; then
echo "Error: Package checksum verification failed"
exit 1
fi
cd ..
echo "All package checksums verified successfully"
- name: Check package integrity
run: |
echo "Checking package integrity..."
for pkg in aur-pkgs/*.pkg.tar*; do
if ! tar -tf "$pkg" >/dev/null 2>&1; then
echo "Error: AUR package file may be corrupted: $pkg"
exit 1
fi
done
for pkg in pkgs/*.pkg.tar*; do
if ! tar -tf "$pkg" >/dev/null 2>&1; then
echo "Error: Package file may be corrupted: $pkg"
exit 1
fi
done
echo "All package files check passed"
- name: Build system image
id: build_image
run: |
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,21 @@ jobs:
PACKAGE_NAME=${PACKAGE_NAME%/}
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
- name: Generate checksums
run: |
cd aur-pkgs
sha256sum *.pkg.tar* > sha256sums.txt
cd ..
- name: Upload Package Archives
uses: actions/upload-artifact@v4
env:
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
with:
name: AUR-packages-${{ env.PACKAGE_NAME }}-${{ hashFiles(format('{0}/PKGBUILD', matrix.package)) }}
path: aur-pkgs/*.pkg.tar*
name: AUR-packages-${{ env.PACKAGE_NAME }}
path: |
aur-pkgs/*.pkg.tar*
aur-pkgs/sha256sums.txt
compression-level: 0

pkgbuild:
needs:
Expand Down Expand Up @@ -103,13 +111,21 @@ jobs:
PACKAGE_NAME=${PACKAGE_NAME%/}
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
- name: Generate checksums for pkgs
run: |
cd pkgs
sha256sum *.pkg.tar* > sha256sums.txt
cd ..
- name: Upload Package Archives
uses: actions/upload-artifact@v4
env:
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
with:
name: Packages-${{ env.PACKAGE_NAME }}-${{ hashFiles(format('{0}/PKGBUILD', matrix.package)) }}
path: pkgs/*.pkg.tar*
name: Packages-${{ env.PACKAGE_NAME }}
path: |
pkgs/*.pkg.tar*
pkgs/sha256sums.txt
compression-level: 0

build:
needs:
Expand Down
20 changes: 4 additions & 16 deletions build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,12 @@ cp -rv pkgs/*.pkg.tar* ${BUILD_PATH}/own_pkgs

# 检查 ${BUILD_PATH}/own_pkgs 和 ${BUILD_PATH}/extra_pkgs 中的 pkg.tar 的完整性, 判断压缩包是否完整
check_pkg() {
local has_error=0
for pkg in $(ls ${BUILD_PATH}/own_pkgs/*.pkg.tar* 2>/dev/null || true); do
if ! tar -tf $pkg >/dev/null 2>&1; then
echo "错误: 包文件损坏或不完整: $pkg"
has_error=1
fi
for pkg in $(ls ${BUILD_PATH}/own_pkgs/*.pkg.tar*); do
tar -tf $pkg
done
for pkg in $(ls ${BUILD_PATH}/extra_pkgs/*.pkg.tar* 2>/dev/null || true); do
if ! tar -tf $pkg >/dev/null 2>&1; then
echo "错误: 包文件损坏或不完整: $pkg"
has_error=1
fi
for pkg in $(ls ${BUILD_PATH}/extra_pkgs/*.pkg.tar*); do
tar -tf $pkg
done
if [ $has_error -eq 0 ]; then
echo "所有包文件检查通过"
else
return 1
fi
}

check_pkg
Expand Down

0 comments on commit b68caf2

Please sign in to comment.