80 lines
3.5 KiB
YAML
80 lines
3.5 KiB
YAML
# This workflow will build an Arch Linux ISO file with the commit on it
|
|
name: build parchiso per release
|
|
on:
|
|
release:
|
|
types:
|
|
- created
|
|
|
|
env:
|
|
api_key: ${{ secrets.GITHUB_TOKEN }}
|
|
name: ${{ github.event.repository.name }}
|
|
release_name: ${{ github.ref_name }}
|
|
GH_TOKEN: ${{ github.token }}
|
|
HOST: mirror.parchlinux.com
|
|
jobs:
|
|
build-beta:
|
|
if: github.event.release.prerelease == true
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux:latest
|
|
options: --privileged
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Packages via Pacman
|
|
run: pacman -Syu --noconfirm; pacman --noconfirm -S git archiso python python-pygithub github-cli reflector p7zip openssh sshpass rsync wget
|
|
- name: Change mirrors
|
|
run: reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
|
|
- name: Build image
|
|
run: mkarchiso -v iso/
|
|
- name: remove last iso
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST rm -rf /srv/http/gnome/
|
|
- name: remove last iso
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST mkdir /srv/http/gnome/
|
|
- name: rename iso
|
|
run: mv "$(ls out/*.iso)" out/Parchlinux-Gnome-beta.iso
|
|
- name: upload iso to host
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" rsync -r "$(ls out/*.iso)" root@mirror.parchlinux.com:/srv/http/gnome/
|
|
- name: Upload iso to the release
|
|
run: |
|
|
cd ./out
|
|
mkdir iso_parts
|
|
# split -d -b 2000M "$(ls *.iso)" iso_parts/"$(ls *.iso)"_part
|
|
#zip -s 2000m iso_parts/"$(ls *.iso)".zip "$(ls *.iso)"
|
|
7z -v1000m a iso_parts/"$(ls *.iso)".zip "$(ls *.iso)"
|
|
md5sum iso_parts/* > iso_parts/md5sums.txt
|
|
gh release upload ${{ github.event.release.tag_name }} ./iso_parts/* -R ${{ github.repository }}
|
|
build:
|
|
if: github.event.release.prerelease == false
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux:latest
|
|
options: --privileged
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Packages via Pacman
|
|
run: pacman -Syu --noconfirm; pacman --noconfirm -S git archiso python python-pygithub github-cli reflector p7zip openssh sshpass rsync wget
|
|
- name: Change mirrors
|
|
run: reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
|
|
- name: Build image
|
|
run: mkarchiso -v iso/
|
|
- name: remove last iso
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST rm -rf /srv/http/gnome/
|
|
- name: remove last iso
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST mkdir /srv/http/gnome/
|
|
- name: rename iso
|
|
run: mv "$(ls out/*.iso)" out/Parchlinux-Gnome-latest.iso
|
|
- name: upload iso to host
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" rsync -r "$(ls out/*.iso)" root@mirror.parchlinux.com:/srv/http/gnome/
|
|
- name: Upload iso to the release
|
|
run: |
|
|
cd ./out
|
|
mkdir iso_parts
|
|
# split -d -b 2000M "$(ls *.iso)" iso_parts/"$(ls *.iso)"_part
|
|
#zip -s 2000m iso_parts/"$(ls *.iso)".zip "$(ls *.iso)"
|
|
7z -v1000m a iso_parts/"$(ls *.iso)".zip "$(ls *.iso)"
|
|
md5sum iso_parts/* > iso_parts/md5sums.txt
|
|
gh release upload ${{ github.event.release.tag_name }} ./iso_parts/* -R ${{ github.repository }}
|