-
Notifications
You must be signed in to change notification settings - Fork 25
115 lines (97 loc) · 3.59 KB
/
ci.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
name: CI
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
debootstrap xorriso genisoimage binutils squashfs-tools \
grub-pc-bin grub-efi-amd64-bin dosfstools mtools xz-utils zstd \
curl rsync dpkg-dev debhelper devscripts build-essential fakeroot \
lintian dh-make pandoc
- name: Set date variable
run: echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Run build - standard i386
run: |
echo "Starting build for standard i386..."
sudo ./minios-cmd -d bookworm -a i386 -de xfce -pv standard -aufs -kl
sudo mkdir -p build/output/standard-i386
sudo mv build/iso/*.iso build/output/standard-i386/
echo "Build completed for standard i386."
- name: Archive build output - standard i386
uses: actions/upload-artifact@v3
with:
name: minios-bookworm-xfce-standard-i386-${{ env.DATE }}
path: build/output/standard-i386/*.iso
- name: Run build - standard amd64
run: |
echo "Starting build for standard amd64..."
sudo ./minios-cmd -d bookworm -a amd64 -de xfce -pv standard -aufs -dkms -kl
sudo mkdir -p build/output/standard-amd64
sudo mv build/iso/*.iso build/output/standard-amd64/
echo "Build completed for standard amd64."
- name: Archive build output - standard amd64
uses: actions/upload-artifact@v3
with:
name: minios-bookworm-xfce-standard-amd64-${{ env.DATE }}
path: build/output/standard-amd64/*.iso
- name: Run build - toolbox amd64
run: |
echo "Starting build for toolbox amd64..."
sudo ./minios-cmd -d bookworm -a amd64 -de xfce -pv toolbox -aufs -dkms -kl
sudo mkdir -p build/output/toolbox-amd64
sudo mv build/iso/*.iso build/output/toolbox-amd64/
echo "Build completed for toolbox amd64."
- name: Archive build output - toolbox amd64
uses: actions/upload-artifact@v3
with:
name: minios-bookworm-xfce-toolbox-amd64-${{ env.DATE }}
path: build/output/toolbox-amd64/*.iso
- name: Build deb package
run: |
echo "Building deb package..."
chmod +x tools/build-package.sh
sudo ./tools/build-package.sh
echo "deb package build completed."
- name: Archive deb package
uses: actions/upload-artifact@v3
with:
name: minios-live-${{ env.DATE }}
path: build/*.deb
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref == 'refs/heads/master' && github.sha || github.ref_name }}
draft: false
prerelease: true
- name: Upload Release Assets
run: |
for artifact in ./artifacts/*; do
asset_name=$(basename $artifact)
echo "Uploading $asset_name"
curl \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$artifact" \
"${{ steps.create_release.outputs.upload_url }}?name=$asset_name"
done