forked from hmtheboy154/Devuan-RootFS
-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (125 loc) · 4.07 KB
/
extract-rootfs.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Generate install.sfs & initrd_lib.tar.gz from Docker Image
on:
schedule:
- cron: "0 0 15 * *"
push:
branches:
- main
- ceres
- downstream
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
run: |
docker build -f Dockerfile . -t devuan
- name: Extract RootFS & generate install.sfs & initrd_lib.tar.gz
run: |
# Create Docker image
docker create --name devuan devuan echo "Devuan"
# Export it to install
mkdir install
docker export devuan | tar -C install -p -s -xv
# Move grub-rescue.iso out
mv install/grub-rescue.iso .
# Remove .dockerenv
rm -rf install/.dockerenv
# Copy boot_hybrid.img for Legacy BIOS
cp install/usr/lib/grub/i386-pc/boot_hybrid.img .
# Copy initrd_lib.tar.gz
cp install/initrd_lib.tar.gz .
# Change ownership of install/ to 0:0
sudo chown -R 0:0 install
# Change chmod of dbus-daemon-launch-helper to 4754 with ownership 0:101
sudo chown 0:101 install/usr/lib/dbus-1.0/dbus-daemon-launch-helper
sudo chmod 4754 install/usr/lib/dbus-1.0/dbus-daemon-launch-helper
# Create install.sfs
sudo mksquashfs install install.sfs -noappend -comp zstd
sudo chmod 755 install.sfs
# Clean up
sudo rm -rf docker_busybox rootfs_busybox.tar.gz install initrd_lib
docker rm devuan
- name: Set Vars
id: vars
run: |
echo "arch=$(dpkg --print-architecture)" >> "$GITHUB_OUTPUT"
- name: Upload install.sfs
uses: actions/upload-artifact@v4
with:
name: install.sfs
path: install.sfs
- name: Upload initrd_lib.tar.gz
uses: actions/upload-artifact@v4
with:
name: initrd_lib.tar.gz
path: initrd_lib.tar.gz
- name: Upload grub-rescue.iso
uses: actions/upload-artifact@v4
with:
name: grub-rescue.iso
path: grub-rescue.iso
- name: Upload boot_hybrid.img
uses: actions/upload-artifact@v4
with:
name: boot_hybrid.img
path: boot_hybrid.img
release:
name: Release
needs: build
if: ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-latest
steps:
- name: Download RootFS
id: download-rootfs
uses: actions/download-artifact@v4
with:
path: out
pattern: "*"
merge-multiple: true
- name: List Files
run: ls -R ${{ steps.download-rootfs.outputs.download-path }}
- uses: "softprops/[email protected]"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
prerelease: false
files: |
${{ steps.download-rootfs.outputs.download-path }}/*
monthly-release:
name: Monthly release
needs: build
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- name: Download rootfs
id: download-rootfs
uses: actions/download-artifact@v4
with:
path: out
pattern: "*"
merge-multiple: true
- name: List Files
run: ls -R ${{ steps.download-rootfs.outputs.download-path }}
- uses: "softprops/[email protected]"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
prerelease: false
tag_name: "r${{ github.run_number }}"
name: "Monthly release r${{ github.run_number }}"
files: |
${{ steps.download-rootfs.outputs.download-path }}/*