box64-debs/.github/workflows/Update-Box64.yml

144 lines
6.3 KiB
YAML

name: Update-Box64
# Controls when the workflow will run
on:
schedule:
- cron: '0 6 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
update-box64:
# The type of runner that the job will run on
runs-on: ubuntu-24.04-arm
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- 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: Install dependencies and build in Docker container
uses: docker://arm64v8/ubuntu:22.04
with:
entrypoint: "/bin/bash"
args: /github/workspace/docker-script.sh
- 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 "pinetmedia@gmail.com" --batch --pinentry-mode="loopback" --passphrase="${{ secrets.PASSPHRASE }}" -abs -o - Release > Release.gpg || error "failed to sign Release.gpg with gpg "
gpg --default-key "pinetmedia@gmail.com" --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 "ryankfortner@gmail.com"
git config --global user.name "ryanfortner"
bash -c "git add . && git commit -m 'Update box64 to commit $(cat commit.txt)'" || true
git push
# jobs:
# update-box64:
# runs-on: ubuntu-24.04-arm
# container: ubuntu:22.04
# defaults:
# run:
# shell: bash
# steps:
# - name: Install dependencies
# run: |
# # add dependencies expected by scripts
# 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-11-aarch64-linux-gnu g++-11-aarch64-linux-gnu gcc-11-aarch64-linux-gnu g++-11-aarch64-linux-gnu \
# binutils-aarch64-linux-gnu
# 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 arm64
# sudo apt update
# sudo apt install -y libc6:arm64
# # 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: |
# sudo apt install checkinstall -y
# - name: Build debs
# run: |
# bash create-deb.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 "pinetmedia@gmail.com" --batch --pinentry-mode="loopback" --passphrase="${{ secrets.PASSPHRASE }}" -abs -o - Release > Release.gpg || error "failed to sign Release.gpg with gpg "
# gpg --default-key "pinetmedia@gmail.com" --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 "ryankfortner@gmail.com"
# git config --global user.name "ryanfortner"
# bash -c "git add . && git commit -m 'Update box64 to commit $(cat commit.txt)'" || true
# git push