Skip to content

Commit d3e0d91

Browse files
committed
add: ci: build-packages
1 parent ad30e80 commit d3e0d91

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Build Arch Repository
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
8+
env:
9+
REPO_NAME: qcom
10+
BUILD_DIR: ${{ github.workspace }}/build
11+
REPO_DIR: ${{ github.workspace }}/repo
12+
13+
jobs:
14+
build-packages:
15+
name: Build Package (${{ matrix.package }})
16+
runs-on: ubuntu-22.04-arm
17+
container: danhunsaker/archlinuxarm
18+
strategy:
19+
matrix:
20+
package: [
21+
'q6voiced',
22+
'soc-qcom-sdm845',
23+
'persistent-mac',
24+
'linux-firmware',
25+
'qbootctl',
26+
'bootmac',
27+
'alsa-ucm-oneplus',
28+
'device-oneplus-fajita',
29+
'device-lenovo-q706f',
30+
'mkbootimg',
31+
'linux-firmware-lenovo-sm8250',
32+
'linux-sdm845',
33+
'linux-sm8250',
34+
'sensors/iio-sensor-proxy',
35+
'sensors/hexagonrpcd',
36+
'sensors/libssc'
37+
]
38+
39+
steps:
40+
41+
- name: Install dependencies
42+
run: |
43+
pacman -Sy --noconfirm \
44+
base-devel \
45+
git \
46+
pacman-contrib \
47+
gnupg \
48+
sudo
49+
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
53+
- name: Build package
54+
working-directory: ${{ github.workspace }}/${{ matrix.package }}
55+
run: |
56+
# 构建参数配置
57+
export MAKEPKG_CONF="/etc/makepkg.conf"
58+
echo 'BUILDENV=(!distcc color !ccache check !sign)' | sudo tee -a $MAKEPKG_CONF
59+
60+
# 清理并构建
61+
makepkg --cleanbuild --syncdeps --noconfirm
62+
63+
- name: Sign package
64+
env:
65+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
66+
working-directory: ${{ github.workspace }}/${{ matrix.package }}
67+
run: |
68+
for pkg in *.pkg.tar.*; do
69+
[[ -f "$pkg" ]] || continue
70+
echo "Signing $pkg ..."
71+
gpg --batch --yes --pinentry-mode loopback \
72+
--passphrase "$GPG_PASSPHRASE" \
73+
--detach-sign --no-armor "$pkg"
74+
done
75+
76+
- name: Upload artifacts
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: ${{ matrix.package }}-pkg
80+
path: |
81+
${{ github.workspace }}/${{ matrix.package }}/*.pkg.tar.*
82+
${{ github.workspace }}/${{ matrix.package }}/*.sig
83+
84+
create-repository:
85+
name: Create Repository
86+
runs-on: ubuntu-22.04-arm
87+
needs: build-packages
88+
steps:
89+
- name: Download all artifacts
90+
uses: actions/download-artifact@v4
91+
with:
92+
path: ${{ env.BUILD_DIR }}
93+
94+
- name: Setup repository directory
95+
run: |
96+
mkdir -p ${{ env.REPO_DIR }}
97+
find ${{ env.BUILD_DIR }} -name '*.pkg.tar.*' -exec cp {} ${{ env.REPO_DIR }} \;
98+
find ${{ env.BUILD_DIR }} -name '*.sig' -exec cp {} ${{ env.REPO_DIR }} \;
99+
100+
- name: Generate repository database
101+
working-directory: ${{ env.REPO_DIR }}
102+
run: |
103+
repo-add -s -v ${{ env.REPO_NAME }}.db.tar.gz *.pkg.tar.zst
104+
ln -s ${{ env.REPO_NAME }}.db.tar.gz ${{ env.REPO_NAME }}.db
105+
ln -s ${{ env.REPO_NAME }}.files.tar.gz ${{ env.REPO_NAME }}.files
106+
107+
- name: Upload repository
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: ${{ env.REPO_NAME }}
111+
path: ${{ env.REPO_DIR }}/*
112+
113+
# - name: Deploy to GitHub Pages
114+
# if: github.ref == 'refs/heads/main'
115+
# uses: peaceiris/actions-gh-pages@v3
116+
# with:
117+
# github_token: ${{ secrets.GITHUB_TOKEN }}
118+
# publish_dir: ${{ env.REPO_DIR }}

0 commit comments

Comments
 (0)