Skip to content

Commit 421c664

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

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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+
curl -L -o /etc/pacman.conf https://github.com/silime/ArchlinuxARM-qcom-aarch64/raw/main/pacman.conf
44+
pacman-key --init && pacman-key --populate archlinuxarm
45+
pacman-key --recv-keys F60FD4C6D426DAB6
46+
pacman-key --lsign F60FD4C6D426DAB6
47+
pacman -Syyu --noconfirm --ask=4 arch-install-scripts cloud-guest-utils sudo binutils fakeroot base-devel git
48+
useradd -m alarm
49+
passwd -d alarm
50+
usermod -aG wheel alarm
51+
echo 'alarm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
52+
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Build package
57+
working-directory: ${{ github.workspace }}/${{ matrix.package }}
58+
run: |
59+
# 构建参数配置
60+
export MAKEPKG_CONF="/etc/makepkg.conf"
61+
echo 'BUILDENV=(!distcc color !ccache check !sign)' | sudo tee -a $MAKEPKG_CONF
62+
# 清理并构建
63+
sudo chown alarm:alarm ./
64+
sudo -u alarm -E makepkg --cleanbuild --syncdeps --noconfirm
65+
66+
- name: Sign package
67+
env:
68+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
69+
working-directory: ${{ github.workspace }}/${{ matrix.package }}
70+
run: |
71+
for pkg in *.pkg.tar.*; do
72+
[[ -f "$pkg" ]] || continue
73+
echo "Signing $pkg ..."
74+
gpg --batch --yes --pinentry-mode loopback \
75+
--passphrase "$GPG_PASSPHRASE" \
76+
--detach-sign --no-armor "$pkg"
77+
done
78+
79+
- name: Upload artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: ${{ matrix.package }}-pkg
83+
path: |
84+
${{ github.workspace }}/${{ matrix.package }}/*.pkg.tar.*
85+
${{ github.workspace }}/${{ matrix.package }}/*.sig
86+
87+
create-repository:
88+
name: Create Repository
89+
runs-on: ubuntu-22.04-arm
90+
needs: build-packages
91+
steps:
92+
- name: Download all artifacts
93+
uses: actions/download-artifact@v4
94+
with:
95+
path: ${{ env.BUILD_DIR }}
96+
97+
- name: Setup repository directory
98+
run: |
99+
mkdir -p ${{ env.REPO_DIR }}
100+
find ${{ env.BUILD_DIR }} -name '*.pkg.tar.*' -exec cp {} ${{ env.REPO_DIR }} \;
101+
find ${{ env.BUILD_DIR }} -name '*.sig' -exec cp {} ${{ env.REPO_DIR }} \;
102+
103+
- name: Generate repository database
104+
working-directory: ${{ env.REPO_DIR }}
105+
run: |
106+
repo-add -s -v ${{ env.REPO_NAME }}.db.tar.gz *.pkg.tar.zst
107+
ln -s ${{ env.REPO_NAME }}.db.tar.gz ${{ env.REPO_NAME }}.db
108+
ln -s ${{ env.REPO_NAME }}.files.tar.gz ${{ env.REPO_NAME }}.files
109+
110+
- name: Upload repository
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: ${{ env.REPO_NAME }}
114+
path: ${{ env.REPO_DIR }}/*
115+
116+
# - name: Deploy to GitHub Pages
117+
# if: github.ref == 'refs/heads/main'
118+
# uses: peaceiris/actions-gh-pages@v3
119+
# with:
120+
# github_token: ${{ secrets.GITHUB_TOKEN }}
121+
# publish_dir: ${{ env.REPO_DIR }}

0 commit comments

Comments
 (0)