2023-10-11 18:16:52 +03:30
|
|
|
# This workflow will build an Arch Linux ISO file with the commit on it
|
2023-06-08 13:58:13 -04:00
|
|
|
name: build parchiso per release
|
2022-06-26 23:43:37 +04:30
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- created
|
2023-06-08 13:58:13 -04:00
|
|
|
|
2023-10-11 18:16:52 +03:30
|
|
|
env:
|
|
|
|
api_key: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
name: ${{ github.event.repository.name }}
|
|
|
|
release_name: ${{ github.ref_name }}
|
|
|
|
GH_TOKEN: ${{ github.token }}
|
2024-07-03 20:09:03 +03:30
|
|
|
HOST: ${{ secrets.SSH_HOST }}
|
2022-06-26 23:43:37 +04:30
|
|
|
jobs:
|
2024-07-03 18:41:36 +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-03 19:28:50 +03:30
|
|
|
run: pacman -Sy; pacman --noconfirm -S git archiso python python-pygithub github-cli reflector p7zip openssh sshpass rsync wget
|
2024-07-03 18:41:36 +03:30
|
|
|
- name: Build image
|
2024-07-03 19:28:50 +03:30
|
|
|
run: |
|
|
|
|
mkdir out
|
|
|
|
cd out
|
2024-07-03 19:31:58 +03:30
|
|
|
touch ParchLinux.gnome.beta.iso
|
2024-07-03 19:28:50 +03:30
|
|
|
# mkarchiso -v iso/
|
2024-07-03 18:41:36 +03:30
|
|
|
- name: remove last iso
|
2024-07-03 20:19:59 +03:30
|
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST rm -rf /srv/http/test/
|
2024-07-03 20:16:18 +03:30
|
|
|
- name: remove last iso
|
2024-07-03 20:19:59 +03:30
|
|
|
run: sshpass -p "${{ secrets.SSH_PASS }}" ssh -o StrictHostKeyChecking=no root@$HOST mkdir /srv/http/test/
|
2024-07-03 18:41:36 +03:30
|
|
|
- name: rename iso
|
2024-07-03 20:05:57 +03:30
|
|
|
run: mv "$(ls out/*.iso)" out/Parchlinux-test-latest.iso
|
2024-07-03 18:41:36 +03:30
|
|
|
- name: upload iso to host
|
2024-07-03 20:36:24 +03:30
|
|
|
# run: sshpass -p "${{ secrets.SSH_PASS }}" rsync -rav -e ssh "out/$(ls out/*.iso)" root@$HOST:/srv/http/test/"
|
|
|
|
uses: burnett01/rsync-deployments@7.0.1
|
|
|
|
with:
|
|
|
|
switches: -avzr --delete
|
|
|
|
legacy_allow_rsa_hostkeys: "true"
|
|
|
|
path: out/Parchlinux-test-latest.iso
|
|
|
|
remote_path: /srv/http/test
|
|
|
|
remote_host: $HOST
|
|
|
|
remote_port: 22
|
|
|
|
remote_user: root
|
|
|
|
remote_key: ${{ secrets.SSH_PASS }}
|
|
|
|
|
2024-07-03 18:41: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
|
|
|
|
#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 }}
|
2022-06-26 23:43:37 +04:30
|
|
|
build:
|
2024-07-03 18:41:36 +03:30
|
|
|
if: github.event.release.prerelease == false
|
2024-03-12 16:32:39 +03:30
|
|
|
permissions:
|
|
|
|
contents: write
|
2022-06-26 23:43:37 +04:30
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: archlinux:latest
|
|
|
|
options: --privileged
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install Packages via Pacman
|
2024-07-03 18:41:36 +03:30
|
|
|
run: pacman -Sy; pacman --noconfirm -S git archiso python python-pygithub github-cli reflector p7zip openssh sshpass rsync
|
2022-06-26 23:43:37 +04:30
|
|
|
- name: Build image
|
|
|
|
run: mkarchiso -v iso/
|
2024-07-03 18:55:31 +03:30
|
|
|
- name: create .ssh folder
|
2024-07-03 19:09:45 +03:30
|
|
|
run: mkdir ~/.ssh
|
2024-07-03 18:41:36 +03:30
|
|
|
- name: generate ssh-key
|
|
|
|
run: ssh-keyscan -H {{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
|
|
|
|
- name: remove last iso
|
|
|
|
run: sshpass -p "{{ secrets.SSH_PASS }}" ssh root@{{ secrets.SSH_HOST }} bash -c "rm -rf /srv/http/test/*"
|
|
|
|
- name: rename iso
|
|
|
|
run: mv "$(ls out/*.iso)" out/Parchlinux-test-latest.iso
|
|
|
|
- name: upload iso to host
|
|
|
|
run: sshpass -p "{{ secrets.SSH_PASS }}" rsync -r "out/$(ls out/*.iso)" root@{{ secrets.SSH_HOST }}:/srv/http/test
|
2022-06-26 23:43:37 +04:30
|
|
|
- name: Upload iso to the release
|
2023-10-11 18:16:52 +03:30
|
|
|
run: |
|
|
|
|
cd ./out
|
2024-03-12 16:32:39 +03:30
|
|
|
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 }}
|