diff --git a/.github/workflows/release.yml b/.github/workflows/amdgpu.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/amdgpu.yml diff --git a/.github/workflows/rocm.yml b/.github/workflows/rocm.yml new file mode 100644 index 0000000..a09929d --- /dev/null +++ b/.github/workflows/rocm.yml @@ -0,0 +1,44 @@ +name: PikaOS Radeon ROCm Sync + +on: + workflow_dispatch + +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 ./rocm.sh && ./rocm.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 }} + diff --git a/amdgpu.sh b/amdgpu.sh index 926f256..a534485 100644 --- a/amdgpu.sh +++ b/amdgpu.sh @@ -1,8 +1,6 @@ #! /bin/bash set -e -apt install -y tree - # AMDGPU MIRROR mkdir -p ./output/amdgpu cd ./output/amdgpu @@ -10,13 +8,13 @@ cd ./output/amdgpu mkdir -p ./libd cd ./libd wget --recursive --no-parent -m http://repo.radeon.com/amdgpu/5.5.3/ubuntu/pool/main/libd/ -# Retrun to AMDGPU MIRROR +# Return to AMDGPU MIRROR cd ../ # amdgpu proprietary dir mkdir -p ./proprietary cd ./proprietary wget --recursive --no-parent -m https://repo.radeon.com/amdgpu/5.5.3/ubuntu/pool/proprietary/ -# Retrun to AMDGPU MIRROR +# Return to AMDGPU MIRROR cd ../ # Get rid of all 20.04 deb files find . -name \*20.04*.deb -exec rm -fv {} \; @@ -24,12 +22,10 @@ find . -name \*20.04*.deb -exec rm -fv {} \; mkdir -p ./amdgpu-dkms-firmware cd ./amdgpu-dkms-firmware wget http://repo.radeon.com/amdgpu/5.5.3/ubuntu/pool/main/a/amdgpu-dkms/amdgpu-dkms-firmware_6.0.5.50503-1620033.20.04_all.deb -# Retrun to AMDGPU MIRROR +# Return to AMDGPU MIRROR cd ../ mkdir -p ./output find . -name \*.deb -exec cp -vf {} ./output \; -# Check final result -tree # Sign the packages dpkg-sig --sign builder ./output/*.deb diff --git a/rocm.sh b/rocm.sh new file mode 100644 index 0000000..e7930cc --- /dev/null +++ b/rocm.sh @@ -0,0 +1,36 @@ +#! /bin/bash +set -e + +apt install tree + +# ROCm MIRROR +mkdir -p ./output/rocm +cd ./output/rocm +# Get ROCm pool +wget -np -c -r -v -nd -R "*20.04*.deb" -A "*" -m "http://repo.radeon.com/rocm/apt/5.6/pool/main/" +# Return to ROCm MIRROR +cd ../ +mkdir -p ./output +find . -name \*.deb -exec cp -vf {} ./output \; + +tree + +# Sign the packages +#dpkg-sig --sign builder ./output/*.deb + +# Pull down existing ppa repo db files etc +#rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo + +# Check if the rocm component exists +#if cat ./output/repo/conf/distributions | grep Components: | grep rocm +#then +# true +#else +# sed -i "s#Components:#Components: rocm#" ./output/repo/conf/distributions +#fi + +# Add the new package to the repo +#reprepro -C rocm -V --basedir ./output/repo/ includedeb lunar ./output/*.deb + +# Push the updated ppa repo to the server +#rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/