-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (72 loc) · 2.73 KB
/
update_repo_rpi.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Update RPi repository
on:
workflow_dispatch:
inputs:
release:
description: Create release?
required: true
type: boolean
env:
RELFILE: rpi_repo.tar.gz
RELNOTESFILE: relnotes.txt
jobs:
update_repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare tmp directories
run: |
mkdir dl
mkdir dist
- name: Install reprepro
run: |
sudo apt-get update
sudo apt-get install -yq reprepro
- name: Import key
env:
RPI_REPO_SECKEY: ${{ secrets.RPI_REPO_SECKEY }}
run: |
echo -n "$RPI_REPO_SECKEY" | gpg --import
- name: Download and unpack latest repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download --dir dl --pattern $RELFILE
tar xzf dl/$RELFILE --directory repo/rpi/var
ls -lR repo/rpi/var
- name: Download packages
uses: dawidd6/action-download-artifact@v2
with:
workflow: create_dpkg.yml
workflow_conclusion: success
path: dl
# Moves from e.g. dl/raspberrypi-bullseye-arm64 to repo/rpi/incoming
- name: Add incoming packages
working-directory: repo/rpi
env:
DPKGDIR: ../../dl
run: |
test ! -d $DPKGDIR/raspbian-buster-armhf || mv $DPKGDIR/raspbian-buster-armhf/* var/incoming/
test ! -d $DPKGDIR/raspbian-bullseye-armhf || mv $DPKGDIR/raspbian-bullseye-armhf/* var/incoming/
test ! -d $DPKGDIR/raspbian-bookworm-armhf || mv $DPKGDIR/raspbian-bookworm-armhf/* var/incoming/
test ! -d $DPKGDIR/raspberrypi-bullseye-arm64 || mv $DPKGDIR/raspberrypi-bullseye-arm64/* var/incoming/
test ! -d $DPKGDIR/raspberrypi-bookworm-arm64 || mv $DPKGDIR/raspberrypi-bookworm-arm64/* var/incoming/
reprepro processincoming default
- name: Pack and prepare release
run: |
tar czf dist/$RELFILE --directory repo/rpi/var/ db publish
ls -lR dist
- name: Create release notes
working-directory: repo/rpi
run: |
echo -e "Distro | Section | Package\n------ | ------- | -------" > ../../$RELNOTESFILE
reprepro list buster >> ../../$RELNOTESFILE
reprepro list bullseye >> ../../$RELNOTESFILE
reprepro list bookworm >> ../../$RELNOTESFILE
cat ../../$RELNOTESFILE
- name: Create release
if: ${{ github.event.inputs.release == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "rpi_rev$GITHUB_RUN_NUMBER" --title "RPi repo revision $GITHUB_RUN_NUMBER" --notes-file $RELNOTESFILE dist/$RELFILE