-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (82 loc) · 3.48 KB
/
default.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: default
on: [push]
jobs:
build:
permissions: write-all # for releasing
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up pacman
run: |
sudo apt-get update
sudo apt-get install pacman-package-manager \
archlinux-keyring libarchive-tools \
systemd-container
sudo mkdir -p /etc/pacman.d
cat <<-EOF | sudo tee -a /etc/pacman.conf >/dev/null
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
EOF
echo Server = 'https://geo.mirror.pkgbuild.com/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist >/dev/null
sudo cp /bin/bash /bin/sh
sudo cp /usr/share/keyrings /usr/share/pacman/keyrings -r
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman -Sy --noconfirm
# Ubuntu's archlinux-keyring is outdated...
sudo pacman -Sddw --noconfirm archlinux-keyring
# why does Ubuntu's pacman looks for keys in
# /usr/share/keyrings instead of /usr/share/pacman/keyrings??
sudo bsdtar -C /usr/share/keyrings -xf /var/cache/pacman/pkg/archlinux-keyring-*.zst --strip-components 4 \
usr/share/pacman/keyrings
sudo pacman-key --populate archlinux
# we don't let ./demolinux install these packages
# since it'd overwrite existing files
sudo apt-get install arch-install-scripts \
btrfs-progs dosfstools erofs-utils \
git gdisk grub-pc libxml2 pv squashfs-tools \
unzip xfsprogs
sudo pacman -Sddw --noconfirm devtools grub
sudo bsdtar -C / -xf /var/cache/pacman/pkg/devtools-*.zst \
usr/bin/makechrootpkg \
usr/bin/mkarchroot \
usr/bin/arch-nspawn \
usr/share/devtools/lib
# our patches made to grub-mkconfig inside bin/mkarchiso
# don't apply to ubuntu's patched grub-mkconfig
sudo bsdtar -C /usr/sbin --strip-components 2 \
-xf /var/cache/pacman/pkg/grub-*.zst \
usr/bin/grub-mkconfig
# Arch's grub-mkconfig expects grub-probe to be in /usr/bin, not sbin...
sudo bsdtar -C / \
-xf /var/cache/pacman/pkg/grub-*.zst \
usr/bin/grub-probe
- name: Build an image
run: ./demolinux build
- name: Split image into chunks
run: |
split -b 2GB out/demolinux*.img demolinux-
- name: Generate checksums file
run: |
sha256sum demolinux-* out/demolinux*.img > sha256sums.txt
- name: Publish release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: refs/tags/master-${{ github.sha }}
release_name: Automatic build from master
body: |
Automatically built from GitHub actions, from the master branch.
Probably unstable.
The image was split into smaller chunks to fit in GitHub releases, you can reassemble it with cat:
cat demolinux-* > demolinux.img
- uses: xresloader/upload-to-github-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "demolinux-*;sha256sums.txt"
release_id: ${{ steps.create_release.outputs.id }}