-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (57 loc) · 2.2 KB
/
pull.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Pull request build
on:
pull_request:
push:
branches: [ 'wait4upstream/*' ]
jobs:
build_and_publish:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
distrib: [debian, fedora, ubuntu]
steps:
- name: Checkout packages
uses: actions/checkout@v4
with:
ref: "${{ github.head_ref }}"
- name: Checkout builder script
uses: actions/checkout@v4
with:
repository: jbigot/pkg_builder
path: pkg_builder
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Checkout distrib repo
uses: actions/checkout@v4
with:
repository: pdidev/repo
path: repo.${{ matrix.distrib }}
ssh-key: ${{ secrets.PDIDEV_REPO_KEY }}
- name: Install deps
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
curl -o - https://www.aptly.info/pubkey.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/aptly.gpg > /dev/null
echo "deb http://repo.aptly.info/ squeeze main" | sudo tee /etc/apt/sources.list.d/aptly.list
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install devscripts equivs aptly
pip3.8 install -r pkg_builder/requirements.txt
- name: Build packages
env:
KEY_PASSPHRASE: ${{ secrets.KEY_PASSPHRASE }}
DISTRIB: ${{ matrix.distrib }}
NEW_BRANCH: "${{ github.head_ref }}."
run: |
git -C repo.${DISTRIB} config user.email "github.action@example.com"
git -C repo.${DISTRIB} config user.name "Github Action"
git -C repo.${DISTRIB} fetch origin ${DISTRIB}
git -C repo.${DISTRIB} checkout --orphan "${NEW_BRANCH}${DISTRIB}"
git -C repo.${DISTRIB} rm -rf .
sed "s%pdidev/repo/%pdidev/repo/${NEW_BRANCH}%g" -i build.conf
python3.8 pkg_builder/pkgbuild -D ${DISTRIB} -j 3 -p "${KEY_PASSPHRASE}"
git -C repo.${DISTRIB} add -A .
git -C repo.${DISTRIB} commit -C origin/${DISTRIB}
git -C repo.${DISTRIB} push -f origin "${NEW_BRANCH}${DISTRIB}"