Add Alpine package build target and metadata generation
- Create CMake target for generating Alpine package (apk) - Add APKBUILD metadata generation in GitHub workflow - Configure package details including version, description, and dependencies - Streamline Alpine package creation process
This commit is contained in:
18
.github/workflows/build-alpine.yml
vendored
18
.github/workflows/build-alpine.yml
vendored
@@ -54,7 +54,23 @@ jobs:
|
|||||||
-DBUILD_STATIC=ON \
|
-DBUILD_STATIC=ON \
|
||||||
..
|
..
|
||||||
make
|
make
|
||||||
# Example packaging command; adjust according to your packaging scripts
|
# Create package metadata
|
||||||
|
mkdir -p pkg/APKBUILD
|
||||||
|
cat > pkg/APKBUILD/APKBUILD << EOF
|
||||||
|
# Contributor: Maintainer <maintainer@example.com>
|
||||||
|
# Maintainer: Maintainer <maintainer@example.com>
|
||||||
|
pkgname=cpu-check
|
||||||
|
pkgver=${{ env.PKG_VERSION }}
|
||||||
|
pkgrel=${{ env.PKG_RELEASE }}
|
||||||
|
pkgdesc="CPU validation and stress testing tool"
|
||||||
|
url="https://github.com/google/cpu-check"
|
||||||
|
arch="x86_64"
|
||||||
|
license="Apache-2.0"
|
||||||
|
depends=""
|
||||||
|
makedepends="cmake clang llvm linux-headers zlib-dev zlib-static openssl-dev openssl-libs-static musl-dev"
|
||||||
|
source=""
|
||||||
|
options="!check"
|
||||||
|
EOF
|
||||||
make apk
|
make apk
|
||||||
|
|
||||||
- name: Upload cpu-check Alpine Package
|
- name: Upload cpu-check Alpine Package
|
||||||
|
@@ -136,3 +136,12 @@ target_link_libraries(silkscreen utils)
|
|||||||
target_link_libraries(cpu_check avx compressor crc32c crypto fvt_controller hasher malign_buffer pattern_generator silkscreen utils)
|
target_link_libraries(cpu_check avx compressor crc32c crypto fvt_controller hasher malign_buffer pattern_generator silkscreen utils)
|
||||||
|
|
||||||
install (TARGETS cpu_check DESTINATION bin)
|
install (TARGETS cpu_check DESTINATION bin)
|
||||||
|
|
||||||
|
# Alpine package target
|
||||||
|
add_custom_target(apk
|
||||||
|
COMMAND mkdir -p "${CMAKE_BINARY_DIR}/pkg/usr/bin"
|
||||||
|
COMMAND cp "${CMAKE_BINARY_DIR}/cpu_check" "${CMAKE_BINARY_DIR}/pkg/usr/bin/"
|
||||||
|
COMMAND cd "${CMAKE_BINARY_DIR}" && tar -czf "cpu-check-${PROJECT_VERSION}-r$ENV{PKG_RELEASE}.apk" -C pkg .
|
||||||
|
DEPENDS cpu_check
|
||||||
|
COMMENT "Creating Alpine package"
|
||||||
|
)
|
||||||
|
Reference in New Issue
Block a user