Skip to content

Commit 2f0f7a0

Browse files
committed
update
1 parent 038c8b4 commit 2f0f7a0

12 files changed

+128
-12
lines changed

.github/workflows/archlinux_x86_64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Build and Upload Images
2424
run: |
2525
distros=("archlinux")
26-
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
2726
for distro in "${distros[@]}"; do
2827
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
2928
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')

.github/workflows/centos_x86_64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Build and Upload Images
2424
run: |
2525
distros=("centos")
26-
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
2726
for distro in "${distros[@]}"; do
2827
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
2928
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')

.github/workflows/clone_yaml.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Clone yaml
1+
name: clone yaml
22

33
on:
44
schedule:

.github/workflows/debian_x86_64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Build and Upload Images
2424
run: |
2525
distros=("debian")
26-
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
2726
for distro in "${distros[@]}"; do
2827
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
2928
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')

.github/workflows/fedora_x86_64.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: fedora x86_64
2+
3+
on:
4+
schedule:
5+
- cron: '30 14 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
fedora_x86_64_images:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: check path
15+
run: |
16+
pwd
17+
18+
- name: Configure Git
19+
run: |
20+
git config --global user.name "daily-update"
21+
git config --global user.email "tg@spiritlhl.top"
22+
23+
- name: Build and Upload Images
24+
run: |
25+
distros=("fedora")
26+
for distro in "${distros[@]}"; do
27+
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
28+
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')
29+
for file in "${zip_name_list[@]}"; do
30+
echo "Building $distro and packge zips"
31+
bash build_images.sh $distro true x86_64
32+
if [ -f "$file" ] && [ $(stat -c %s "$file") -gt 1048576 ]; then
33+
echo "Checking if $file already exists in release..."
34+
existing_asset_id=$(curl -s -H "Accept: application/vnd.github.v3+json" \
35+
"https://api.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets" \
36+
| jq -r --arg name "$(basename "$file")" '.[] | select(.name == $name) | .id')
37+
if [ -n "$existing_asset_id" ]; then
38+
echo "Asset $file already exists in release, deleting existing asset..."
39+
delete_response=$(curl -s -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/oneclickvirt/incus_images/releases/assets/$existing_asset_id")
40+
echo "$delete_response"
41+
if [ $? -eq 0 ] && ! echo "$delete_response" | grep -q "error"; then
42+
echo "Existing asset deleted successfully."
43+
else
44+
echo "Failed to delete existing asset. Skipping file upload..."
45+
rm -rf $file
46+
continue
47+
fi
48+
else
49+
echo "No $file file."
50+
fi
51+
echo "Uploading $file to release..."
52+
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
53+
-H "Content-Type: application/zip" \
54+
--data-binary @"$file" \
55+
"https://uploads.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets?name=$(basename "$file")"
56+
rm -rf $file
57+
else
58+
echo "No $file or less than 10 MB"
59+
fi
60+
done
61+
done
62+

.github/workflows/gentoo_x86_64.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: gentoo x86_64
2+
3+
on:
4+
schedule:
5+
- cron: '30 11 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
gentoo_x86_64_images:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: check path
15+
run: |
16+
pwd
17+
18+
- name: Configure Git
19+
run: |
20+
git config --global user.name "daily-update"
21+
git config --global user.email "tg@spiritlhl.top"
22+
23+
- name: Build and Upload Images
24+
run: |
25+
distros=("gentoo")
26+
for distro in "${distros[@]}"; do
27+
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
28+
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')
29+
for file in "${zip_name_list[@]}"; do
30+
echo "Building $distro and packge zips"
31+
bash build_images.sh $distro true x86_64
32+
if [ -f "$file" ] && [ $(stat -c %s "$file") -gt 1048576 ]; then
33+
echo "Checking if $file already exists in release..."
34+
existing_asset_id=$(curl -s -H "Accept: application/vnd.github.v3+json" \
35+
"https://api.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets" \
36+
| jq -r --arg name "$(basename "$file")" '.[] | select(.name == $name) | .id')
37+
if [ -n "$existing_asset_id" ]; then
38+
echo "Asset $file already exists in release, deleting existing asset..."
39+
delete_response=$(curl -s -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/oneclickvirt/incus_images/releases/assets/$existing_asset_id")
40+
echo "$delete_response"
41+
if [ $? -eq 0 ] && ! echo "$delete_response" | grep -q "error"; then
42+
echo "Existing asset deleted successfully."
43+
else
44+
echo "Failed to delete existing asset. Skipping file upload..."
45+
rm -rf $file
46+
continue
47+
fi
48+
else
49+
echo "No $file file."
50+
fi
51+
echo "Uploading $file to release..."
52+
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
53+
-H "Content-Type: application/zip" \
54+
--data-binary @"$file" \
55+
"https://uploads.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets?name=$(basename "$file")"
56+
rm -rf $file
57+
else
58+
echo "No $file or less than 10 MB"
59+
fi
60+
done
61+
done
62+

.github/workflows/kali_x86_64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Build and Upload Images
2424
run: |
2525
distros=("kali")
26-
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
2726
for distro in "${distros[@]}"; do
2827
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
2928
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')

.github/workflows/openwrt_x86_64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Build and Upload Images
2424
run: |
2525
distros=("openwrt")
26-
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
2726
for distro in "${distros[@]}"; do
2827
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
2928
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')

.github/workflows/oralce_x86_64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Build and Upload Images
2424
run: |
2525
distros=("oracle")
26-
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
2726
for distro in "${distros[@]}"; do
2827
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
2928
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')

.github/workflows/rockylinux_x86_64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Build and Upload Images
2424
run: |
2525
distros=("rockylinux")
26-
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
2726
for distro in "${distros[@]}"; do
2827
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
2928
release_id=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/oneclickvirt/incus_images/releases/tags/$distro" | jq -r '.id')

0 commit comments

Comments
 (0)