Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
valerius committed Jan 16, 2024
1 parent 1700364 commit f4357b5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/rpi-aarch64-image-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
LOOP_IMAGE: archlinux-aarch64-rpi.img
LOOP_IMAGE_SIZE: 4G
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
RPI_MODEL: 4
RPI_MODEL: 5
ARM_VERSION: aarch64
DEFAULT_LOCALE: en_US.UTF-8
TIMEZONE: Europe/Paris
Expand Down Expand Up @@ -121,23 +121,23 @@ jobs:
"$RPI_HOSTNAME" \
"$SSH_PUB_KEY"
# - name: Upload Image and Get URL
# if: success()
# run: |
# ISO_URL=$(curl --upload-file $LOOP_IMAGE_PATH https://pub.strat.zone/)
# echo "ISO_URL=$ISO_URL" >> $GITHUB_ENV
- name: Upload Image and Get URL
if: success()
run: |
ISO_URL=$(curl --upload-file $LOOP_IMAGE_PATH https://pub.strat.zone/)
echo "ISO_URL=$ISO_URL" >> $GITHUB_ENV
# - name: Notify Success
# if: success()
# run: |
# SUCCESS_MESSAGE="🎉 Awesome! The Raspberry Pi image build succeeded 🚀\nAuthor: ${{ github.actor }}\nBranch: ${{ github.ref }}\nCommit Message: ${{ github.event.head_commit.message }}\n[View Last Commit](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 📜\nThe custom-built Archlinux image for Raspberry Pi Model ${{ env.RPI_MODEL }} with ${{ env.ARM_VERSION }} architecture is now available for download:\n[Download Image]($ISO_URL) 📦\nFilename: archlinux-${{ env.ARM_VERSION }}-rpi-${{ env.RPI_MODEL }}.img"
# curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$SUCCESS_MESSAGE\"}" $DISCORD_WEBHOOK_URL
- name: Notify Success
if: success()
run: |
SUCCESS_MESSAGE="🎉 Awesome! The Raspberry Pi image build succeeded 🚀\nAuthor: ${{ github.actor }}\nBranch: ${{ github.ref }}\nCommit Message: ${{ github.event.head_commit.message }}\n[View Last Commit](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 📜\nThe custom-built Archlinux image for Raspberry Pi Model ${{ env.RPI_MODEL }} with ${{ env.ARM_VERSION }} architecture is now available for download:\n[Download Image]($ISO_URL) 📦\nFilename: archlinux-${{ env.ARM_VERSION }}-rpi-${{ env.RPI_MODEL }}.img"
curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$SUCCESS_MESSAGE\"}" $DISCORD_WEBHOOK_URL
# - name: Notify Failure
# if: failure()
# run: |
# FAILURE_MESSAGE="😞 Oops! The pipeline for **${{ github.repository }}** has failed.\n[Check the logs and troubleshoot here.](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 🛠️"
# curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$FAILURE_MESSAGE\"}" $DISCORD_WEBHOOK_URL
- name: Notify Failure
if: failure()
run: |
FAILURE_MESSAGE="😞 Oops! The pipeline for **${{ github.repository }}** has failed.\n[Check the logs and troubleshoot here.](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 🛠️"
curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$FAILURE_MESSAGE\"}" $DISCORD_WEBHOOK_URL
- name: Umount Loop Device
if: always()
Expand All @@ -147,11 +147,11 @@ jobs:
echo "Unmounted $WORKDIR_BASE"
sync
# - name: Delete Work Folder
# if: always()
# run: |
# sudo rm -rf $WORKDIR_BASE
# echo "Work folder deleted"
- name: Delete Work Folder
if: always()
run: |
sudo rm -rf $WORKDIR_BASE
echo "Work folder deleted"
- name: Release Loop Device
if: always()
Expand Down
9 changes: 7 additions & 2 deletions build-archlinux-rpi-aarch64-img.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,18 @@ echo "Installing packages..."
# Install packages
arch-chroot $WORKDIR_BASE/root pacman -S --noconfirm $PACKAGES

# Install linux-rpiX kernel and eeprom
# create a if statement to check if variable INSTALL_RPI_KERNEL is true
# Install linux-rpiX kernel and eeprom if variable INSTALL_RPI_KERNEL is true
if [ "$INSTALL_RPI_KERNEL" = true ] ; then
echo "Installing linux-${$RPI_MODEL} kernel and eeprom..."
arch-chroot $WORKDIR_BASE/root pacman -S --noconfirm rpi${RPI_MODEL}-eeprom
fi

# Remove linux-aarch64 uboot-raspberrypi
arch-chroot $WORKDIR_BASE/root pacman -R --noconfirm linux-aarch64 uboot-raspberrypi

# install linux-rpi kernel and linux-rpi-headers
arch-chroot $WORKDIR_BASE/root pacman -S --noconfirm linux-rpi linux-rpi-headers

echo "Setup hostname..."
# Set the hostname
arch-chroot $WORKDIR_BASE/root /bin/bash -c "echo \"$RPI_HOSTNAME\" | tee /etc/hostname"
Expand Down

0 comments on commit f4357b5

Please sign in to comment.