-
Notifications
You must be signed in to change notification settings - Fork 4
174 lines (156 loc) · 7.47 KB
/
Update-Box86.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Update-Box86
# Controls when the workflow will run
on:
schedule:
- cron: '0 6 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
update-box86-bionic:
runs-on: ubuntu-20.04
container: ubuntu:18.04
defaults:
run:
shell: bash
steps:
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y software-properties-common lsb-release \
sudo wget curl build-essential jq autoconf automake \
pkg-config ca-certificates rpm apt-utils \
python3 make gettext pinentry-tty devscripts dpkg-dev \
gcc-8-arm-linux-gnueabihf g++-8-arm-linux-gnueabihf binutils-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf \
qemu-user-static
sudo sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c) main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c)-updates main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install -y libc6:armhf
# install new enough git to run actions/checkout
sudo add-apt-repository ppa:git-core/ppa -y
sudo add-apt-repository ppa:theofficialgman/cmake-bionic -y
sudo apt update
sudo apt install -y git cmake
# avoid "fatal: detected dubious ownership in repository" error
git config --global --add safe.directory '*'
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install checkinstall
run: |
git clone https://github.com/ryanfortner/checkinstall
cd checkinstall
sudo make install
cd .. && rm -rf checkinstall
- name: Build debs (bionic)
run: |
bash create-deb-bionic.sh || true
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Write new package to repo
run: |
export DIRECTORY="$GITHUB_WORKSPACE"
cd $DIRECTORY/debian
rm $DIRECTORY/debian/Packages || echo "Failed to remove packages file"
rm $DIRECTORY/debian/Packages.gz || echo "Failed to remove packages.gz file"
rm $DIRECTORY/debian/Release || echo "Failed to remove release file"
rm $DIRECTORY/debian/Release.gpg || echo "Failed to remove release.gpg file"
rm $DIRECTORY/debian/InRelease || echo "Failed to remove inrelease file"
dpkg-scanpackages --multiversion . > Packages
gzip -k -f Packages
apt-ftparchive release . > Release
gpg --default-key "[email protected]" --batch --pinentry-mode="loopback" --passphrase="${{ secrets.PASSPHRASE }}" -abs -o - Release > Release.gpg || error "failed to sign Release.gpg with gpg "
gpg --default-key "[email protected]" --batch --pinentry-mode="loopback" --passphrase="${{ secrets.PASSPHRASE }}" --clearsign -o - Release > InRelease || error "failed to sign InRelease with gpg"
- name: Upload
run: |
if [[ -f exited_successfully.txt ]]; then
rm exited_successfully.txt
exit 0
fi
cd $GITHUB_WORKSPACE
git config http.postBuffer 3221225472
git config --global user.email "[email protected]"
git config --global user.name "ryanfortner"
bash -c "git add . && git commit -m '[gcc-8 builds] Update box86 to commit $(cat commit-bionic.txt)'" || true
git push
update-box86-focal:
runs-on: ubuntu-20.04
container: ubuntu:20.04
defaults:
run:
shell: bash
needs: update-box86-bionic
steps:
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y software-properties-common lsb-release \
sudo wget curl build-essential jq autoconf automake \
pkg-config ca-certificates rpm apt-utils \
python3 make gettext pinentry-tty devscripts dpkg-dev \
gcc-9-arm-linux-gnueabihf g++-9-arm-linux-gnueabihf binutils-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf \
qemu-user-static
sudo sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c) main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c)-updates main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install -y libc6:armhf
# install new enough git to run actions/checkout
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install -y git cmake
# avoid "fatal: detected dubious ownership in repository" error
git config --global --add safe.directory '*'
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install checkinstall
run: |
git clone https://github.com/ryanfortner/checkinstall
cd checkinstall
sudo make install
cd .. && rm -rf checkinstall
- name: Build debs (focal)
run: |
bash create-deb-focal.sh
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Write new package to repo
run: |
export DIRECTORY="$GITHUB_WORKSPACE"
cd $DIRECTORY/debian
rm $DIRECTORY/debian/Packages || echo "Failed to remove packages file"
rm $DIRECTORY/debian/Packages.gz || echo "Failed to remove packages.gz file"
rm $DIRECTORY/debian/Release || echo "Failed to remove release file"
rm $DIRECTORY/debian/Release.gpg || echo "Failed to remove release.gpg file"
rm $DIRECTORY/debian/InRelease || echo "Failed to remove inrelease file"
dpkg-scanpackages --multiversion . > Packages
gzip -k -f Packages
apt-ftparchive release . > Release
gpg --default-key "[email protected]" --batch --pinentry-mode="loopback" --passphrase="${{ secrets.PASSPHRASE }}" -abs -o - Release > Release.gpg || error "failed to sign Release.gpg with gpg "
gpg --default-key "[email protected]" --batch --pinentry-mode="loopback" --passphrase="${{ secrets.PASSPHRASE }}" --clearsign -o - Release > InRelease || error "failed to sign InRelease with gpg"
- name: Upload
run: |
if [[ -f exited_successfully.txt ]]; then
rm exited_successfully.txt
exit 0
fi
cd $GITHUB_WORKSPACE
git config http.postBuffer 3221225472
git config --global user.email "[email protected]"
git config --global user.name "ryanfortner"
bash -c "git add . && git commit -m '[gcc-9 builds] Update box86 to commit $(cat commit-focal.txt)'" || true
git push