parch-runit/.github/workflows/build.yaml

76 lines
2.5 KiB
YAML
Raw Normal View History

2023-06-13 13:46:17 +05:45
# GHW workflow to build metislinux iso
2023-06-13 21:25:53 +05:45
name: Build Metis Linux ISO per Release
2023-06-13 13:46:17 +05:45
on:
push:
env:
api_key: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.event.repository.name }}
release_name: ${{ github.ref_name }}
2023-06-13 21:25:53 +05:45
2023-06-13 13:46:17 +05:45
jobs:
build:
runs-on: ubuntu-latest
container:
image: artixlinux/runit:latest
options: --privileged
steps:
2023-06-13 21:25:53 +05:45
- name: Cloning the repository
uses: actions/checkout@v3
- name: Installing artools and dependencies
2023-06-13 13:46:17 +05:45
run: |
pacman --noconfirm -Sy ruby artools iso-profiles man-pages man
- name: Setting up filesystem for the build
2023-06-13 13:46:17 +05:45
run: |
dd if=/dev/zero of=/tmp/loopfs.img bs=1024 count=8000000
losetup /dev/loop3 /tmp/loopfs.img
mkfs.ext4 /dev/loop3
mkdir -p /var/lib/artools
mount /dev/loop3 /var/lib/artools
- name: Building image (may take up to 6 minutes)
2023-06-13 13:46:17 +05:45
run: |
mkdir ~/artools-workspace/iso-profiles -p
cp base ~/artools-workspace/iso-profiles -r
mkdir ~/.config/artools -p
cp config/pacman.conf /usr/share/artools/pacman.conf.d/default.conf
cp -r config/me* /etc/pacman.d/
./build-iso.sh
echo "NOW=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Find ISO path and name
2023-06-13 21:25:53 +05:45
id: find_iso
2023-06-13 13:46:17 +05:45
run: |
ISO_PATH=$(find ~/artools-workspace/iso -name "artix-base-runit-${{ env.NOW }}-x86_64.iso" | head -n 1)
echo "ISO_PATH=$ISO_PATH" >> $GITHUB_ENV
2023-06-13 21:25:53 +05:45
echo "::set-output name=iso_path::$ISO_PATH"
2023-06-13 13:46:17 +05:45
- name: Generate SHA256 checksum
2023-06-13 21:25:53 +05:45
id: generate_checksum
run: |
2023-06-13 21:25:53 +05:45
CHECKSUM=$(sha256sum "${{ steps.find_iso.outputs.iso_path }}" | awk '{print $1}')
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_ENV
2023-06-13 21:25:53 +05:45
echo "::set-output name=checksum::$CHECKSUM"
2023-06-13 21:47:07 +05:45
- name: Create checksum file
run: |
echo "${{ steps.generate_checksum.outputs.checksum }} ${{ steps.find_iso.outputs.iso_path }}" > checksum.txt
- name: Upload image and checksum to releases
2023-06-13 13:46:17 +05:45
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
2023-06-13 21:47:07 +05:45
files: |
${{ steps.find_iso.outputs.iso_path }}
checksum.txt
asset_names: |
metis-linux-runit-${{ env.NOW }}-x86_64.iso
metis-linux-runit-${{ env.NOW }}-x86_64.iso.sha256
2023-06-13 13:46:17 +05:45
tag: MetisLinux-${{ env.NOW }}
overwrite: true
body: This is the release of Metis Linux ISO on ${{ env.NOW }}