This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
Bootstrapping + releasing distro rootfs' #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bootstrapping + releasing distro rootfs' | |
on: | |
push: | |
branches: [ "main" ] | |
schedule: | |
- cron: "0 0 * * *" # run at the start of every day | |
workflow_dispatch: | |
jobs: | |
bootstrap-fedora: | |
strategy: | |
matrix: | |
version: [ "39", "40" ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Installing dependencies | |
run: sudo apt-get update && sudo apt-get install -y dnf curl | |
- name: Adding yum repos for dnf | |
run: sudo cp -r configs/yum.repos.d/ /etc/yum.repos.d/ | |
- name: Downloading GPG keys for dnf | |
run: | | |
# dnf needs gpg keys to work -> get them from the latest rawhide gpg keys package | |
# numbers in the rawhide package name can change -> dynamically determine the name | |
package_name=$(curl -L https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/f/ | grep fedora-gpg-keys- | awk -F'>' '{print $3}' | awk -F'<' '{print $1}') | |
# download package | |
curl -LO https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/f/$package_name | |
# extract package content into root | |
rpm2cpio fedora-gpg-keys-*.noarch.rpm | sudo cpio -idmv -D / | |
- name: Bootstrapping Fedora ${{ matrix.version }} | |
run: sudo bash bootstrap_fedora.sh ${{ matrix.version }} | |
- name: Uploading RootFS as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fedora-${{ matrix.version }} | |
retention-days: 1 | |
path: | | |
/tmp/fedora-rootfs-${{ matrix.version }}.tar.xz | |
/tmp/fedora-rootfs-${{ matrix.version }}.sha256 | |
bootstrap-ubuntu: | |
strategy: | |
matrix: | |
version: [ "22.04", "23.10" ] | |
codename: ["jammy", "mantic"] | |
exclude: | |
- version: 22.04 | |
codename: mantic | |
- version: 23.10 | |
codename: jammy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Installing dependencies | |
run: sudo apt-get update && sudo apt-get install -y debootstrap | |
- name: Bootstrapping ubuntu ${{ matrix.version }} | |
run: sudo bash debootstrap.sh ubuntu ${{ matrix.version }} ${{ matrix.codename }} | |
- name: Uploading rootfs as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ubuntu-${{ matrix.version }} | |
retention-days: 1 | |
path: | | |
/tmp/ubuntu-rootfs-${{ matrix.version }}.tar.xz | |
/tmp/ubuntu-rootfs-${{ matrix.version }}.sha256 | |
bootstrap-debian: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Installing dependencies | |
run: sudo apt-get update && sudo apt-get install -y debootstrap | |
- name: Bootstrapping debian stable | |
run: sudo bash debootstrap.sh debian stable bookworm | |
- name: Uploading rootfs as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: debian-stable | |
retention-days: 1 | |
path: | | |
/tmp/debian-rootfs-stable.tar.xz | |
/tmp/debian-rootfs-stable.sha256 | |
repack-pop-os: | |
strategy: | |
matrix: | |
distro: [ "pop-os" ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Installing dependencies | |
run: sudo apt-get install -y curl squashfs-tools | |
- name: Repacking ${{ matrix.distro }} rootfs | |
run: sudo bash repack_pop-os.sh ${{ matrix.distro }} | |
- name: Splitting tar archive | |
run: sudo split --verbose -b 1900MB /tmp/distro/${{ matrix.distro }}-rootfs-22.04.tar.xz /tmp/distro/${{ matrix.distro }}-rootfs-22.04.split. | |
- name: Uploading ${{ matrix.distro }} rootfs as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.distro }} | |
retention-days: 1 | |
path: | | |
/tmp/distro/${{ matrix.distro }}-rootfs-22.04.split.* | |
/tmp/distro/${{ matrix.distro }}-rootfs-22.04.sha256 | |
create-release: | |
runs-on: ubuntu-latest | |
needs: [ bootstrap-fedora, bootstrap-ubuntu, bootstrap-debian, repack-pop-os ] | |
steps: | |
- name: Downloading RootFS artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: /tmp/artifacts/ | |
- name: Generating release tag | |
id: tag | |
run: | | |
date=$(date +"%Y.%m.%d_%H-%M") | |
echo "release_tag=$date" >> $GITHUB_OUTPUT | |
- name: Creating new release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
name: Automated RootFS build - ${{ steps.tag.outputs.release_tag }} | |
body: | | |
These are completely **unmodified** distro RootFS images. | |
See the [README](https://github.com/eupnea-project/distro-rootfs) for more information. | |
files: | | |
/tmp/artifacts/*/* |