Update-Box86 #578
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |