You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iso/.github/workflows/build.yml

66 lines
1.9 KiB
YAML

name: Build ISO
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.SECRET_TOKEN }}
container:
image: ghcr.io/crystal-linux/crystal:latest
options: --privileged
steps:
- name: Build
id: build
run: |
# Set BUILD_DATE
# 2022-09-29
export BUILD_DATE=$(date +'%Y-%m-%d')
# Make sure container is up-to-date
pacman -Syu --needed --noconfirm
pacman -S --noconfirm --needed bind
# Make sure repo.getcryst.al is up
nslookup repo.getcryst.al
# Install necessary packages
pacman -S git archiso pacman-contrib --needed --noconfirm
# Clone ISO repo and enter it
git clone https://github.com/crystal-linux/iso/
cd iso
# Build ISO and rename to match BUILD_DATE
bash build.sh --build-iso
if [[ ! "$(ls *.iso)" == "crystal-live-${BUILD_DATE}-x86_64.iso" ]]; then
mv *.iso crystal-live-${BUILD_DATE}-x86_64.iso
fi
md5sum *.iso > MD5SUM-iso
gzip crystal-live-${BUILD_DATE}-x86_64.iso
md5sum *.iso.gz > MD5SUM-iso.gz
# Remove chrooted.sh in between operations
rm chrooted.sh
# Likewise, but for the rootfs
bash build.sh --build-bootstrap
mv *.tar.gz crystal-rootfs-${BUILD_DATE}-x86_64.tar.gz
md5sum *.tar.gz > MD5SUM-rootfs
# Set upload name to BUILD_DATE
echo "::set-output name=date::${BUILD_DATE}"
- name: Upload
uses: ncipollo/release-action@v1
with:
artifacts: "iso/*.iso.gz,iso/MD5SUM-iso*,iso/*.tar.gz,iso/MD5SUM-rootfs"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.build.outputs.date }}