|
| 1 | +name: Build EndeavourOS ISO |
| 2 | +on: [push, pull_request, workflow_dispatch] |
| 3 | +jobs: |
| 4 | + build: |
| 5 | + runs-on: ubuntu-latest |
| 6 | + steps: |
| 7 | + - name: Checkout Repo |
| 8 | + if: ${{ !contains(github.event.head_commit.message, '[no build]') }} |
| 9 | + uses: actions/checkout@v2 |
| 10 | + - name: Build In Docker |
| 11 | + if: ${{ !contains(github.event.head_commit.message, '[no build]') }} |
| 12 | + run: | |
| 13 | + cat << \EOF > entrypoint.sh |
| 14 | + pacman -Syu base base-devel reflector --needed --noconfirm |
| 15 | + reflector --verbose --country $(curl https://ipv4.myip.wtf/text/country) --protocol http,https --latest 10 --sort rate --save /etc/pacman.d/mirrorlist |
| 16 | + pacman-key --init |
| 17 | + pacman -Syu wget --needed --noconfirm |
| 18 | + pacman -Syu archlinux-keyring --noconfirm |
| 19 | + cd /etc/pacman.d/ |
| 20 | + touch endeavouros-mirrorlist |
| 21 | + echo "Server = https://mirror.funami.tech/endeavouros/repo/\$repo/\$arch" > endeavouros-mirrorlist |
| 22 | + echo "Server = https://mirror.jingk.ai/endeavouros/repo/\$repo/\$arch" >> endeavouros-mirrorlist |
| 23 | + cat endeavouros-mirrorlist |
| 24 | + cd .. |
| 25 | + printf "\n" >> pacman.conf |
| 26 | + echo "[endeavouros]" >> pacman.conf |
| 27 | + echo "SigLevel = Never" >> pacman.conf |
| 28 | + echo "Include = /etc/pacman.d/endeavouros-mirrorlist" >> pacman.conf |
| 29 | + printf "\n" >> pacman.conf |
| 30 | + cat pacman.conf |
| 31 | + wget https://raw.githubusercontent.com/endeavouros-team/keyring/main/endeavouros.gpg -O endeavouros.gpg |
| 32 | + wget https://mirror.funami.tech/endeavouros/repo/endeavouros/x86_64/endeavouros-keyring-20230523-1-any.pkg.tar.zst |
| 33 | + pacman -U endeavouros-keyring-20230523-1-any.pkg.tar.zst --noconfirm --needed |
| 34 | + pacman-key --add endeavouros.gpg && sudo pacman-key --lsign-key 497AF50C92AD2384C56E1ACA003DB8B0CB23504F |
| 35 | + pacman-key --populate |
| 36 | + pacman-key --recv-keys 8BE1FEE14302371DEF6F910A0E5877AC225D1980 --keyserver hkps://keyserver.ubuntu.com |
| 37 | + pacman-key --lsign-key 8BE1FEE14302371DEF6F910A0E5877AC225D1980 |
| 38 | + pacman-key --populate |
| 39 | + pacman -Syu |
| 40 | + pacman-key --populate |
| 41 | + pacman-key --populate archlinux |
| 42 | + cd /build |
| 43 | + useradd builduser -m |
| 44 | + passwd -d builduser |
| 45 | + pacman -Syu --noconfirm --needed sudo git base-devel |
| 46 | + pacman -S archiso mkinitcpio-archiso git squashfs-tools --needed --noconfirm |
| 47 | + printf "builduser ALL=NOPASSWD: ALL\n" | tee -a /etc/sudoers |
| 48 | + chown -R builduser:builduser ./ |
| 49 | + sudo -u builduser bash ./prepare.sh |
| 50 | + ./mkarchiso "." |
| 51 | + EOF |
| 52 | +
|
| 53 | + |
| 54 | + |
| 55 | +
|
| 56 | + docker run --privileged -t -v $PWD:/build archlinux /bin/bash /build/entrypoint.sh |
| 57 | + |
| 58 | + - name: Upload Built ISO |
| 59 | + if: ${{ github.ref == 'refs/heads/galileo' && !contains(github.event.head_commit.message, '[no rel]') && !contains(github.event.head_commit.message, '[no build]') }} |
| 60 | + uses: actions/upload-artifact@v2 |
| 61 | + with: |
| 62 | + name: built-iso |
| 63 | + path: ${{ github.workspace }}/out/*.iso |
| 64 | + - name: Create Tag |
| 65 | + id: create_tag |
| 66 | + if: ${{ github.ref == 'refs/heads/galileo' && !contains(github.event.head_commit.message, '[no rel]') && !contains(github.event.head_commit.message, '[no build]') }} |
| 67 | + run: | |
| 68 | + export TAG=$(date +%Y.%m.%d) |
| 69 | + echo "::set-output name=tag::${TAG}" |
| 70 | + echo $TAG |
| 71 | + - name: Release |
| 72 | + if: ${{ github.ref == 'refs/heads/galileo' && !contains(github.event.head_commit.message, '[no rel]') && !contains(github.event.head_commit.message, '[no build]') }} |
| 73 | + uses: softprops/action-gh-release@v1 |
| 74 | + with: |
| 75 | + files: | |
| 76 | + ${{ github.workspace }}/out/*.iso |
| 77 | + tag_name: ${{ steps.create_tag.outputs.tag }} |
| 78 | + name: ${{ steps.create_tag.outputs.tag }} |
| 79 | + draft: ${{ contains(github.event.head_commit.message, '[draft]') }} |
| 80 | + prerelease: ${{ contains(github.event.head_commit.message, '[prerel]') }} |
| 81 | + body: | |
| 82 | + Follow [this guide](https://wiki.t2linux.org/distributions/endeavouros/installation/) using this ISO to install EndeavourOS on your T2 Mac |
| 83 | + env: |
| 84 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments