Some checks failed
Build / build (push) Failing after 1m11s
Switch from GitHub Release upload to direct Gitea Package Registry deployment for Debian package, using curl and authentication via secrets
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential cmake libabsl-dev clang checkinstall
|
|
|
|
- name: Create build directory
|
|
run: mkdir build
|
|
|
|
- name: Configure the project
|
|
run: |
|
|
cd build
|
|
CC=clang CXX=clang++ cmake ..
|
|
|
|
- name: Build the project
|
|
run: |
|
|
cd build
|
|
make
|
|
|
|
- name: Create Debian Package
|
|
run: |
|
|
cd build
|
|
sudo checkinstall --pkgname=cpu-check \
|
|
--pkgversion=1.0.0 \
|
|
--pkgrelease=1 \
|
|
--maintainer="maintainer@example.com" \
|
|
--requires="libabsl-dev" \
|
|
--default \
|
|
--pakdir=. \
|
|
--backup=no \
|
|
--deldoc=yes \
|
|
--deldesc=yes \
|
|
--delspec=yes \
|
|
make install
|
|
|
|
- name: Upload Debian Package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: cpu-check-deb
|
|
path: build/*.deb
|
|
|
|
- name: Upload to Gitea Package Registry
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
run: |
|
|
curl --user "${{ secrets.GITEA_USERNAME }}:${{ secrets.GITEA_TOKEN }}" \
|
|
--upload-file build/cpu-check_1.0.0-1_amd64.deb \
|
|
"https://gitea.ericxliu.me/api/packages/${{ secrets.GITEA_USERNAME }}/debian/pool/stable/main/upload" |