Parch-iso-gnome/.github/workflows/build.yaml

81 lines
3.5 KiB
YAML
Raw Normal View History

2024-01-15 15:05:36 +03:30
# 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 }}
2024-07-10 00:10:30 +03:30
HOST: mirror.parchlinux.com
2024-01-15 15:05:36 +03:30
jobs:
2024-07-10 00:10:30 +03:30
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
2024-07-11 12:53:42 +03:30
run: pacman -Syu --noconfirm; pacman --noconfirm -S git archiso python python-pygithub github-cli reflector p7zip openssh sshpass rsync wget
2024-07-10 00:24:46 +03:30
- name: Change mirrors
run: reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
2024-07-10 00:10:30 +03:30
- name: Build image
run: mkarchiso -v iso/
- name: remove last iso
2024-07-10 00:14:25 +03:30
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST rm -rf /srv/http/gnome/
2024-07-10 00:10:30 +03:30
- name: remove last iso
2024-07-10 00:14:25 +03:30
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST mkdir /srv/http/gnome/
2024-07-10 00:10:30 +03:30
- name: rename iso
2024-07-10 00:14:25 +03:30
run: mv "$(ls out/*.iso)" out/Parchlinux-Gnome-beta.iso
2024-07-10 00:10:30 +03:30
- name: upload iso to host
2024-07-10 00:14:25 +03:30
run: sshpass -p "${{ secrets.SSH_PASS }}" rsync -r "$(ls out/*.iso)" root@mirror.parchlinux.com:/srv/http/gnome/
2024-07-10 00:10:30 +03:30
- 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 }}
2024-01-15 15:05:36 +03:30
build:
2024-07-10 00:10:30 +03:30
if: github.event.release.prerelease == false
2024-01-15 15:05:36 +03:30
permissions:
contents: write
runs-on: ubuntu-latest
container:
image: archlinux:latest
options: --privileged
steps:
- uses: actions/checkout@v3
- name: Install Packages via Pacman
2024-07-11 12:53:42 +03:30
run: pacman -Syu --noconfirm; pacman --noconfirm -S git archiso python python-pygithub github-cli reflector p7zip openssh sshpass rsync wget
2024-07-10 00:24:46 +03:30
- name: Change mirrors
run: reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
2024-01-15 15:05:36 +03:30
- name: Build image
run: mkarchiso -v iso/
2024-07-10 00:10:30 +03:30
- name: remove last iso
2024-07-10 00:14:25 +03:30
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST rm -rf /srv/http/gnome/
2024-07-10 00:10:30 +03:30
- name: remove last iso
2024-07-10 00:14:25 +03:30
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST mkdir /srv/http/gnome/
2024-07-10 00:10:30 +03:30
- name: rename iso
2024-07-10 00:14:25 +03:30
run: mv "$(ls out/*.iso)" out/Parchlinux-Gnome-latest.iso
2024-07-10 00:10:30 +03:30
- name: upload iso to host
2024-07-10 00:14:25 +03:30
run: sshpass -p "${{ secrets.SSH_PASS }}" rsync -r "$(ls out/*.iso)" root@mirror.parchlinux.com:/srv/http/gnome/
2024-01-15 15:05:36 +03:30
- name: Upload iso to the release
run: |
cd ./out
mkdir iso_parts
# split -d -b 2000M "$(ls *.iso)" iso_parts/"$(ls *.iso)"_part
2024-07-10 00:10:30 +03:30
#zip -s 2000m iso_parts/"$(ls *.iso)".zip "$(ls *.iso)"
7z -v1000m a iso_parts/"$(ls *.iso)".zip "$(ls *.iso)"
2024-01-15 15:05:36 +03:30
md5sum iso_parts/* > iso_parts/md5sums.txt
gh release upload ${{ github.event.release.tag_name }} ./iso_parts/* -R ${{ github.repository }}