Add Debian and Alpine Linux package build support to GitHub Actions
- Introduce Debian and Alpine Linux package build stages in CI/CD pipeline - Configure CMake for static compilation on both platforms - Add artifact upload for Debian (.deb) and Alpine (.apk) packages - Include static Abseil library build process for both distributions
This commit is contained in:
61
.github/workflows/build-alpine.yml
vendored
Normal file
61
.github/workflows/build-alpine.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: Build Alpine Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
PKG_VERSION: "2.2.0"
|
||||||
|
PKG_RELEASE: "1"
|
||||||
|
ABSEIL_VERSION: "20230125.3"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-alpine:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: alpine:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install Alpine Packaging Dependencies
|
||||||
|
run: |
|
||||||
|
apk update
|
||||||
|
apk add alpine-sdk cmake clang llvm
|
||||||
|
|
||||||
|
- name: Build Static Abseil
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/abseil/abseil-cpp.git
|
||||||
|
cd abseil-cpp
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||||
|
-DABSL_BUILD_TESTING=OFF \
|
||||||
|
-DABSL_USE_GOOGLETEST_HEAD=OFF \
|
||||||
|
-DCMAKE_CXX_STANDARD=17 \
|
||||||
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
|
..
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
ldconfig
|
||||||
|
|
||||||
|
- name: Build Alpine Package
|
||||||
|
run: |
|
||||||
|
mkdir -p alpine_build && cd alpine_build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DUSE_CLANG=ON \
|
||||||
|
-DBUILD_STATIC=ON \
|
||||||
|
..
|
||||||
|
make
|
||||||
|
# Example packaging command; adjust according to your packaging scripts
|
||||||
|
make apk
|
||||||
|
|
||||||
|
- name: Upload Alpine Package
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: cpu-check-alpine
|
||||||
|
path: alpine_build/*.apk
|
@@ -1,4 +1,4 @@
|
|||||||
name: Build
|
name: Build Debian Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -12,7 +12,7 @@ env:
|
|||||||
ABSEIL_VERSION: "20230125.3"
|
ABSEIL_VERSION: "20230125.3"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-debian:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -77,31 +77,9 @@ jobs:
|
|||||||
name: cpu-check-deb
|
name: cpu-check-deb
|
||||||
path: build/*.deb
|
path: build/*.deb
|
||||||
|
|
||||||
- name: Install Alpine Packaging Dependencies
|
|
||||||
run: |
|
|
||||||
sudo apk update
|
|
||||||
sudo apk add alpine-sdk cmake clang llvm
|
|
||||||
|
|
||||||
- name: Build Alpine Package
|
|
||||||
run: |
|
|
||||||
mkdir -p alpine_build && cd alpine_build
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DUSE_CLANG=ON \
|
|
||||||
-DBUILD_STATIC=ON \
|
|
||||||
..
|
|
||||||
make
|
|
||||||
# Example packaging command; adjust according to your packaging scripts
|
|
||||||
make apk
|
|
||||||
|
|
||||||
- name: Upload Alpine Package
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: cpu-check-alpine
|
|
||||||
path: alpine_build/*.apk
|
|
||||||
|
|
||||||
- name: Upload to Gitea Package Registry
|
- name: Upload to Gitea Package Registry
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: |
|
||||||
curl --user "eric:df299a6e592a8bd829d018b7816e76d03756408d" \
|
curl --user "eric:df299a6e592a8bd829d018b7816e76d03756408d" \
|
||||||
--upload-file build/cpu-check_${{ env.PKG_VERSION }}-${{ env.PKG_RELEASE }}_amd64.deb \
|
--upload-file build/cpu-check_${{ env.PKG_VERSION }}-${{ env.PKG_RELEASE }}_amd64.deb \
|
||||||
"https://git.ericxliu.me/api/packages/eric/debian/pool/bionic/main/upload"
|
"https://git.ericxliu.me/api/packages/eric/debian/pool/bionic/main/upload"
|
Reference in New Issue
Block a user