Skip to content

Commit 059cd88

Browse files
committed
ci
1 parent f542ad1 commit 059cd88

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/build.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build Images
2+
3+
on:
4+
schedule:
5+
- cron: '0 14 1 * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubnutu-latest
11+
steps:
12+
13+
- name: Checkout Images
14+
uses: actions/checkout@v4
15+
with:
16+
path: images
17+
18+
- name: Install dependencies
19+
run: |
20+
sudo apt install mmdebstrap parted jq btrfs-progs wget unzip multipath-tools dosfstools arch-install-scripts debian-archive-keyring git gdisk
21+
wget https://apt.ameridroid.com/stable/pool/main/i/imageforge/imageforge_1.1.0_all.deb
22+
sudo dpkg -i imageforge_1.1.0_all.deb
23+
24+
25+
- name: Build Debian Image
26+
run: |
27+
sudo umount -R ./work-deb/aarch64/* || true
28+
for i in {1..3}; do
29+
sudo python3 ./images/nova-bookworm/profiledef -c ./images/nova-bookworm/ -w ./work-deb -o ./out && break
30+
done
31+
32+
- name: Cleanup
33+
if: always()
34+
run: |
35+
sudo umount -R ./work-deb/aarch64/* || true
36+
sudo rm -rf ./work-deb
37+
38+
- name: Set current date as tag name
39+
id: set_tag_name
40+
run: echo "TAG_NAME=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
41+
42+
- name: Create Release
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
REPO: ${{ github.repository }}
46+
TAG_NAME: ${{ env.TAG_NAME }}
47+
id: create_release
48+
run: |
49+
RELEASE_BODY=""
50+
for i in $(ls ./out/*.img.xz); do
51+
FILENAME=$(basename $i)
52+
SHA256=$(sha256sum $i | awk '{ print $1 }')
53+
RELEASE_BODY+="\nsha256 for $FILENAME:\n\`\`\`\n$SHA256\n\`\`\`\n"
54+
done
55+
56+
RELEASE_RESPONSE=$(curl -s -X POST \
57+
-H "Authorization: token $GITHUB_TOKEN" \
58+
-H "Content-Type: application/json" \
59+
-d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\", \"body\": \"$RELEASE_BODY\", \"draft\": false, \"prerelease\": false}" \
60+
"https://api.github.com/repos/$REPO/releases")
61+
62+
RELEASE_ID=$(echo $RELEASE_RESPONSE | jq -r '.id')
63+
64+
if [ "$RELEASE_ID" == "null" ]; then
65+
echo "Failed to create a release. Response: $RELEASE_RESPONSE"
66+
exit 1
67+
fi
68+
69+
for file in ./out/*.img.xz; do
70+
curl -X POST \
71+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
72+
-H "Content-Type: application/octet-stream" \
73+
-T "$file" \
74+
"https://uploads.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=$(basename "$file")"
75+
done
76+
77+
- name: Clean up
78+
run: |
79+
rm ./out/ -rf

nova-bookworm/profiledef

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ has_uefi = True
2424
cmdline = "console=ttyFIQ0,1500000n8 console=tty1 console=both loglevel=7 rw panic=10 init=/sbin/init rootflags=subvol=@ rootfstype=btrfs"
2525
grubcmdl = "console=ttyFIQ0,1500000n8 console=tty1 console=both rw init=/sbin/init"
2626
grubdtb = "/6.1.0-1023-rockchip/dtbs/rockchip/rk3588s-indiedroid-nova.dtb"
27+
2728
partition_table = lambda img_size, fs: {
2829
"UEFI": ["0%", "8M", "8M", "NONE"],
2930
"boot": ["9M", "32M", "24M", "fat32"],

0 commit comments

Comments
 (0)