Skip to content

v0.2.1

v0.2.1 #14

Workflow file for this run

name: Release Linux
on:
workflow_dispatch:
release:
types: [ created, edited ]
jobs:
#
# Fetch Tools
#
fetch:
runs-on: ubuntu-latest
steps:
- name: Install tools
run: |
sudo env DEBIAN_FRONTEND=noninteractive apt install -y tar xz-utils
- name: Fetch Magick
run: |
mkdir -p bin
wget -O bin/magick "https://github.com/ruanformigoni/imagemagick-static-musl/releases/download/cc3f21c/magick-x86_64"
wget -O bin/magick-license "https://raw.githubusercontent.com/ImageMagick/ImageMagick/main/LICENSE"
chmod +x bin/magick
- name: Fetch coreutils
run: |
wget "https://github.com/ruanformigoni/coreutils-static/releases/download/d7f4cd2/coreutils-x86_64.tar.xz"
# Extracts a bin/... folder
tar xf "coreutils-x86_64.tar.xz"
- name: Fetch lsof
run: |
mkdir -p ./bin
wget -O./bin/lsof "https://github.com/ruanformigoni/lsof-static-musl/releases/download/e1a88fb/lsof-x86_64"
- name: Fetch e2fsprogs
run: |
mkdir -p bin
wget -O ./bin/fuse2fs "https://github.com/ruanformigoni/e2fsprogs/releases/download/e58f946/fuse2fs"
wget -O ./bin/mke2fs "https://github.com/ruanformigoni/e2fsprogs/releases/download/e58f946/mke2fs"
wget -O ./bin/e2fsck "https://github.com/ruanformigoni/e2fsprogs/releases/download/e58f946/e2fsck"
wget -O ./bin/resize2fs "https://github.com/ruanformigoni/e2fsprogs/releases/download/e58f946/resize2fs"
- name: Fetch proot
run: |
mkdir -p ./bin
wget -O ./bin/proot "https://github.com/ruanformigoni/proot/releases/download/5a4be11/proot"
- name: Fetch bwrap
run: |
mkdir -p ./bin
wget -O ./bin/bwrap "https://github.com/ruanformigoni/bubblewrap-musl-static/releases/download/559a725/bwrap"
- name: Fetch overlayfs
run: |
mkdir -p ./bin
wget -O ./bin/overlayfs "https://github.com/ruanformigoni/fuse-overlayfs/releases/download/af507a2/fuse-overlayfs-x86_64"
- name: Fetch dwarfs
run: |
mkdir -p ./dwarfs
wget -Odwarfs.tar.xz https://github.com/mhx/dwarfs/releases/download/v0.6.2/dwarfs-0.6.2-Linux.tar.xz
tar xf dwarfs.tar.xz --strip-components=1 -Cdwarfs
mkdir -p ./bin
mv ./dwarfs/bin/mkdwarfs ./bin
mv ./dwarfs/bin/dwarfsextract ./bin
mv ./dwarfs/sbin/dwarfs2 ./bin/dwarfs
- name: Fetch bash
run: |
mkdir -p bin
wget -O ./bin/bash "https://github.com/ruanformigoni/bash-static/releases/download/5355251/bash-linux-x86_64"
- name: Upload Tools
uses: actions/upload-artifact@v3
with:
name: tools
path: bin
#
# Build
#
build:
strategy:
matrix:
dist: [arch,alpine,jammy]
runs-on: ubuntu-latest
needs: fetch
steps:
# Install required tools
- name: Install tools
run: |
sudo env DEBIAN_FRONTEND=noninteractive apt install -y tar xz-utils debootstrap coreutils
# Download source from repository
- uses: actions/checkout@v4
# Download Artifacts from the fetch job
- uses: actions/download-artifact@v3
with:
name: tools
path: bin
# Build the main elf
- name: Build Elf
run: |
docker build . \
--build-arg FIM_DIST=${{ matrix.dist }} \
-t "flatimage:${{ matrix.dist }}" \
-f docker/Dockerfile.elf
docker run \
--rm -v $(pwd):/workdir "flatimage:${{ matrix.dist }}" \
cp /fim/dist/main /workdir/elf-${{ matrix.dist }}
# Build the flatimage
- name: Build ArchLinux
if: matrix.dist == 'arch'
run: |
cp elf-${{ matrix.dist }} bin/elf
sudo ./src/scripts/_build.sh archbootstrap
- name: Build Alpine
if: matrix.dist == 'alpine'
run: |
cp elf-${{ matrix.dist }} bin/elf
sudo ./src/scripts/_build.sh alpinebootstrap
- name: Build Jammy
if: matrix.dist == 'jammy'
run: |
cp elf-${{ matrix.dist }} bin/elf
sudo ./src/scripts/_build.sh debootstrap jammy
# Upload
- name: Upload flatimage
uses: actions/upload-artifact@v3
with:
name: flatimage
path: dist
#
# Release
#
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: flatimage
path: dist
- name: Upload to release
uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: dist/
GHR_REPLACE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}