This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-08-27 20:12:06 +03:00 committed by GitHub
parent 25fb8ef144
commit 58369eb912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 87 additions and 2 deletions

46
.github/workflows/external-winehq.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: PikaOS WineHQ Repo Sync (External)
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: self-hosted
container:
image: ghcr.io/pikaos-linux/pika-package-container:latest
volumes:
- /proc:/proc
options: --privileged -it
steps:
- uses: actions/checkout@v3
- 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 SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
if_key_exists: replace
- name: Sync Repository
run: chmod +x ./external-winehq.sh && ./external-winehq.sh
- name: Purge cache
uses: jakejarvis/cloudflare-purge-action@master
env:
# Zone is required by both authentication methods
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
PURGE_URLS: ${{ vars.PURGE_URLS }}

View File

@ -19,8 +19,47 @@ rm -rf /etc/apt/preferences.d/*pika*
# Get Extranal WineHQ pool # Get Extranal WineHQ pool
echo 'deb [trusted=yes] https://dl.winehq.org/wine-builds/ubuntu lunar main' | sudo tee /etc/apt/sources.list.d/external.list echo 'deb [trusted=yes] https://dl.winehq.org/wine-builds/ubuntu lunar main' | sudo tee /etc/apt/sources.list.d/external.list
apt update -y
PPP32=$(../../ppp https://ppa.pika-os.com/dists/lunar/external/binary-i386/Packages https://dl.winehq.org/wine-builds/ubuntu/dists/lunar/main/binary-i386/Packages) # Get i386 packages list
wget https://dl.winehq.org/wine-builds/ubuntu/dists/lunar/main/binary-i386/Packages -o i386-wine-pkg
PKG_I386=$(cat i386-wine-pkg | grep "Package: " | awk '{print $2}' | sort -u )
touch ppp32.list
for i in $(cat $PKG_I386)
do
touch /etc/apt/preferences.d/0-external-sync.conf
echo 'Package': * > /etc/apt/preferences.d/0-external-sync.conf
echo 'Pin: release o=ppa.pika-os.com' >> /etc/apt/preferences.d/0-external-sync.conf
echo 'Pin-Priority: 1000' >> /etc/apt/preferences.d/0-external-sync.conf
apt-cache show $i | grep 'Version:' | cut -d":" -f2 | head -n1 | sed 's/ //g' > $i-pika-i386
rm -rf /etc/apt/preferences.d/0-external-sync.conf
apt-cache show $i | grep 'Version:' | cut -d":" -f2 | head -n1 | sed 's/ //g' > $i-external-i386
if [[ $(cat $i-pika-i386) == $(cat $i-external-i386) ]]
then
echo $i >> ppp32.list
fi
done
# Get amd64 packages list
wget https://dl.winehq.org/wine-builds/ubuntu/dists/lunar/main/binary-amd64/Packages -o amd64-wine-pkg
PKG_AMD64=$(cat amd64-wine-pkg | grep "Package: " | awk '{print $2}' | sort -u )
touch ppp64.list
for i in $(cat $PKG_AMD64)
do
touch /etc/apt/preferences.d/0-external-sync.conf
echo 'Package': * > /etc/apt/preferences.d/0-external-sync.conf
echo 'Pin: release o=ppa.pika-os.com' >> /etc/apt/preferences.d/0-external-sync.conf
echo 'Pin-Priority: 1000' >> /etc/apt/preferences.d/0-external-sync.conf
apt-cache show $i | grep 'Version:' | cut -d":" -f2 | head -n1 | sed 's/ //g' > $i-pika-amd64
rm -rf /etc/apt/preferences.d/0-external-sync.conf
apt-cache show $i | grep 'Version:' | cut -d":" -f2 | head -n1 | sed 's/ //g' > $i-external-amd64
if [[ $(cat $i-pika-amd64) == $(cat $i-external-amd64) ]]
then
echo $i >> ppp64.list
fi
done
PPP32=$(cat ppp32.list | tr '\n' ' ')
if [ ! -z "$PPP32" ] if [ ! -z "$PPP32" ]
then then
dpkg --add-architecture i386 dpkg --add-architecture i386
@ -31,7 +70,7 @@ else
echo "i386 Repos are synced" echo "i386 Repos are synced"
fi fi
PPP64=$(../../ppp https://ppa.pika-os.com/dists/lunar/external/binary-amd64/Packages https://dl.winehq.org/wine-builds/ubuntu/dists/lunar/main/binary-amd64/Packages) PPP64=$(cat ppp64.list | tr '\n' ' ')
if [ ! -z "$PPP64" ] if [ ! -z "$PPP64" ]
then then
apt update -o APT::Architecture="amd64" -o APT::Architectures="amd64" -y --allow-unauthenticated apt update -o APT::Architecture="amd64" -o APT::Architectures="amd64" -y --allow-unauthenticated