diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 62d9d59..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# 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 }} -jobs: - build: - 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 -Sy; pacman --noconfirm -S git archiso python python-pygithub github-cli reflector p7zip zip unzip - - name: Change Arch docker mirror - run: reflector -c "US" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist - - name: Build image - run: mkarchiso -v iso/ - - 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 1000m 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 }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..18e4375 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,36 @@ +stages: + - build + - deploy + +image: archlinux/archlinux:base-devel + +variables: + Desktop: "mate" + +build_iso: + stage: build + script: + - ./build.sh + - echo "Renaming the output ISO file" + - mv out/*.iso out/ParchLinux-$Desktop-latest.iso + artifacts: + paths: + - out/ParchLinux-$Desktop-latest.iso + rules: + - if: $CI_COMMIT_TAG + +deploy_iso: + stage: deploy + dependencies: + - build_iso + script: + - echo "Installing sshpass and rsync" + - pacman -Syu --noconfirm sshpass rsync + - echo "Removing old ISO files from remote directory" + - sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no parch@$SSH_ROOT rm -rf /srv/http/$Desktop/ + - echo "Creating new directory on remote host" + - sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no parch@$SSH_ROOT mkdir -p /srv/http/$Desktop/ + - echo "Uploading new ISO via rsync" + - sshpass -p "$PASS" rsync -r out/ParchLinux-$Desktop-latest.iso parch@$SSH_ROOT:/srv/http/$Desktop/ + rules: + - if: $CI_COMMIT_TAG diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 238bac4..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,46 +0,0 @@ -ci: - autoupdate_branch: "2.1.x" - autoupdate_schedule: monthly -repos: - - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 - hooks: - - id: pyupgrade - args: ["--py36-plus"] - - repo: https://github.com/asottile/reorder_python_imports - rev: v3.1.0 - hooks: - - id: reorder-python-imports - name: Reorder Python imports (src, tests) - files: "^(?!examples/)" - args: ["--application-directories", "src"] - additional_dependencies: ["setuptools>60.9"] - - repo: https://github.com/psf/black - rev: 22.3.0 - hooks: - - id: black - - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 - hooks: - - id: flake8 - additional_dependencies: - - flake8-bugbear - - flake8-implicit-str-concat - - repo: https://github.com/peterdemin/pip-compile-multi - rev: v2.4.5 - hooks: - - id: pip-compile-multi-verify - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 - hooks: - - id: fix-byte-order-marker - - id: trailing-whitespace - - id: end-of-file-fixer - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 - hooks: - - id: fix-byte-order-marker - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-case-conflict - - id: check-merge-conflict diff --git a/README.md b/README.md index 0acc702..05bcfb8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ -# Parch Linux iso template +# [![](https://git.parchlinux.com/artwork/Arts/-/raw/main/Logo/NewLogo/logo.png){width=32px} Parch Linux](https://parchlinux.com) [![](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Mate-logo.svg/1024px-Mate-logo.svg.png){width=32px}](https://mate-desktop.org/) MATE desktop (_community version_) -## Use this template for making releases \ No newline at end of file +You can download the live/installation ISO [from the mirror](https://mirror.parchlinux.com/mate/). + +[![](https://img.shields.io/gitlab/v/tag/iso%2Fcommunity%2Fparch-iso-mate?gitlab_url=https%3A%2F%2Fgit.parchlinux.com%2F&style=for-the-badge&logo=mate&label=Latest%20build&labelColor=%232f2f2f&color=%231AA67E)](https://mirror.parchlinux.com/mate/ParchLinux-mate-latest.iso) + +> **Notice:** +> If you encountered any problem with this version, you can start an thread in [Parch Linux forum](https://forum.parchlinux.com/). +> Optionally, you can mention the maintainer of this version ([@almasi](https://forum.parchlinux.com/u/almasi/)) in Parch Linux forum. diff --git a/build.sh b/build.sh index c865e6e..58c74c4 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ main() { set -e local Black DarkGray Red LightRed Green LightGreen Brown Yellow Blue LightBlue Purple Light Purple Cyan LightCyan LightGray White reset - ## save colors + ## Save colors Black="\e[0;30m" DarkGray="\e[1;30m" Red="\e[0;31m" @@ -23,38 +23,34 @@ main() { local reponame reponame=${PWD##*/} - echo -e "$Green### start install packeges for build $reponame ###$reset" - echo -e "$Brown### checking your os ###$reset" + echo -e "$Green### Start install packages for build $reponame ###$reset" + echo -e "$Brown### Checking your OS ###$reset" if type pacman >/dev/null 2>&1;then if [ "$(id -u)" != "0" ]; then - echo -e "$Red### you are not in root$reset" + echo -e "$Red### You are not in root$reset" exit 1 else install - echo -e "$Blue### install complete ###$reset" - echo -e "$Green### start build $reponame with archiso ###$reset" - build - makezip + echo -e "$Blue### Install complete ###$reset" + echo -e "$Green### Start build $reponame with archiso ###$reset" + build fi else - echo -e "$Red###os cant supported###$reset" + echo -e "$Red###OS can't supported###$reset" exit 1 fi } + install() { set -e - pacman -Sy; pacman --noconfirm -S --needed git archiso github-cli p7zip + pacman -Sy; pacman --noconfirm -S --needed git archiso github-cli p7zip reflector rsync } + + build() { set -e mkarchiso -v iso/ } -makezip() { - cd out - 7z -v500m a "$(ls *.iso)".zip "$(ls *.iso)" - md5sum * > md5sums.txt -} - main diff --git a/iso/packages.x86_64 b/iso/packages.x86_64 index 023c24b..e63fc7e 100644 --- a/iso/packages.x86_64 +++ b/iso/packages.x86_64 @@ -164,3 +164,6 @@ parch-welcome fira-code-font fira-code-mono vazirmatn-fonts + +# Community Changes +boost diff --git a/iso/pacman.conf b/iso/pacman.conf index 4794755..8d4c0db 100644 --- a/iso/pacman.conf +++ b/iso/pacman.conf @@ -35,10 +35,13 @@ Architecture = auto CheckSpace #VerbosePkgLists #ParallelDownloads = 5 +DownloadUser = alpm + + # By default, pacman accepts packages signed by keys that its local keyring # trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional +SigLevel = Never LocalFileSigLevel = Optional #RemoteFileSigLevel = Required @@ -72,6 +75,10 @@ LocalFileSigLevel = Optional #[core-testing] #Include = /etc/pacman.d/mirrorlist +[ppr] +SigLevel = Optional TrustedOnly +Server = https://git.parchlinux.com/repo/ppr/-/raw/main/x86_64/ + [core] Include = /etc/pacman.d/mirrorlist @@ -87,16 +94,13 @@ Include = /etc/pacman.d/mirrorlist #[multilib-testing] #Include = /etc/pacman.d/mirrorlist -[multilib] -Include = /etc/pacman.d/mirrorlist - -[ppr] -SigLevel = Optional TrustedOnly -Server = https://raw.githubusercontent.com/parchlinux/ppr/main/x86_64/ +#[multilib] +#Include = /etc/pacman.d/mirrorlist [pcp] SigLevel = Optional TrustedOnly -Server = https://raw.githubusercontent.com/parchlinux/pcp/main/x86_64/ +Server = https://git.parchlinux.com/repo/pcp/-/raw/main/x86_64/ + # An example of a custom package repository. See the pacman manpage for # tips on creating your own repositories. diff --git a/iso/profiledef.sh b/iso/profiledef.sh index c040aa5..85712ad 100644 --- a/iso/profiledef.sh +++ b/iso/profiledef.sh @@ -1,24 +1,26 @@ #!/usr/bin/env bash # shellcheck disable=SC2034 -iso_name="Parchlinux Mate" -iso_label="PARCH_LINUX_MATE_$(date +%Y%m)" -iso_publisher="Parch Linux " -iso_application="Parch Linux Live/Rescue CD" -iso_version="$(date +%Y.%m.%d)" +iso_name="Parch Linux Mate" +iso_label="ParchLinux_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)" +iso_publisher="Parch Linux " +iso_application="Parch Linux Live/Rescue DVD" +iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)" install_dir="arch" buildmodes=('iso') bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' - 'uefi-x64.systemd-boot.esp' - 'uefi-x64.systemd-boot.eltorito') + 'uefi-ia32.systemd-boot.esp' 'uefi-x64.systemd-boot.esp' + 'uefi-ia32.systemd-boot.eltorito' 'uefi-x64.systemd-boot.eltorito') arch="x86_64" pacman_conf="pacman.conf" airootfs_image_type="squashfs" airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M') +bootstrap_tarball_compression=('zstd' '-c' '-T0' '--auto-threads=logical' '--long' '-19') file_permissions=( ["/etc/shadow"]="0:0:400" ["/root"]="0:0:750" ["/root/.automated_script.sh"]="0:0:755" + ["/root/.gnupg"]="0:0:700" ["/usr/local/bin/choose-mirror"]="0:0:755" ["/usr/local/bin/Installation_guide"]="0:0:755" ["/usr/local/bin/livecd-sound"]="0:0:755" diff --git a/tools/upload_asset.py b/tools/upload_asset.py deleted file mode 100644 index 527e736..0000000 --- a/tools/upload_asset.py +++ /dev/null @@ -1,65 +0,0 @@ -import hashlib -import logging -import os -import sys -from datetime import datetime -from pathlib import Path - -from github import Github - -logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") - -api_key = os.getenv("API_KEY", None) -current_date = datetime.today().strftime("%Y-%m-%d") - - -def _compute_sha256(file_name): - hash_sha256 = hashlib.sha256() - with open(file_name, "rb") as f: - for chunk in iter(lambda: f.read(4096), b""): - hash_sha256.update(chunk) - return hash_sha256.hexdigest() - - -_path = list(Path().cwd().glob("out/*.iso"))[0] -path = _path.as_posix() - -file_name = _path.name - -hash = _compute_sha256(path) - -repo_name = os.getenv("REPO_NAME", None) -release_name = os.getenv("RELEASE_NAME", None) - -logging.info("Starting at %s", current_date) - -if not (repo_name and api_key and release_name): - logging.error( - "'REPO_NAME'/'API_KEY'/'RELEASE_NAME' not found in your environment vars." - "please add this and run again." - ) - sys.exit(1) - - -gh = Github(api_key) -print(repo_name, api_key) -repo = gh.get_repo(repo_name) - -release = repo.get_release(release_name) - -logging.info("Statrting upload ISO to release") - -release.upload_asset(path=path) -logging.info("ISO uploaded.") - -# update release -msg = ( - release.body - + f""" -| name | sha256 | -| :---: | :---: | -| {file_name} | {hash} |""" -) -logging.info("Starting update release msg with: \n %s" % msg) -release.update_release(name=release.tag_name, message=msg) -logging.info("Release update is done.")