Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Feb 21, 2024
1 parent 038c8b4 commit 2f0f7a0
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/archlinux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("archlinux")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/centos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("centos")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clone_yaml.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Clone yaml
name: clone yaml

on:
schedule:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/debian_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("debian")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/fedora_x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: fedora x86_64

on:
schedule:
- cron: '30 14 * * *'
workflow_dispatch:

jobs:
fedora_x86_64_images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: check path
run: |
pwd
- name: Configure Git
run: |
git config --global user.name "daily-update"
git config --global user.email "tg@spiritlhl.top"
- name: Build and Upload Images
run: |
distros=("fedora")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
for file in "${zip_name_list[@]}"; do
echo "Building $distro and packge zips"
bash build_images.sh $distro true x86_64
if [ -f "$file" ] && [ $(stat -c %s "$file") -gt 1048576 ]; then
echo "Checking if $file already exists in release..."
existing_asset_id=$(curl -s -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets" \
| jq -r --arg name "$(basename "$file")" '.[] | select(.name == $name) | .id')
if [ -n "$existing_asset_id" ]; then
echo "Asset $file already exists in release, deleting existing asset..."
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")
echo "$delete_response"
if [ $? -eq 0 ] && ! echo "$delete_response" | grep -q "error"; then
echo "Existing asset deleted successfully."
else
echo "Failed to delete existing asset. Skipping file upload..."
rm -rf $file
continue
fi
else
echo "No $file file."
fi
echo "Uploading $file to release..."
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/zip" \
--data-binary @"$file" \
"https://uploads.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets?name=$(basename "$file")"
rm -rf $file
else
echo "No $file or less than 10 MB"
fi
done
done
62 changes: 62 additions & 0 deletions .github/workflows/gentoo_x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: gentoo x86_64

on:
schedule:
- cron: '30 11 * * *'
workflow_dispatch:

jobs:
gentoo_x86_64_images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: check path
run: |
pwd
- name: Configure Git
run: |
git config --global user.name "daily-update"
git config --global user.email "tg@spiritlhl.top"
- name: Build and Upload Images
run: |
distros=("gentoo")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
for file in "${zip_name_list[@]}"; do
echo "Building $distro and packge zips"
bash build_images.sh $distro true x86_64
if [ -f "$file" ] && [ $(stat -c %s "$file") -gt 1048576 ]; then
echo "Checking if $file already exists in release..."
existing_asset_id=$(curl -s -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets" \
| jq -r --arg name "$(basename "$file")" '.[] | select(.name == $name) | .id')
if [ -n "$existing_asset_id" ]; then
echo "Asset $file already exists in release, deleting existing asset..."
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")
echo "$delete_response"
if [ $? -eq 0 ] && ! echo "$delete_response" | grep -q "error"; then
echo "Existing asset deleted successfully."
else
echo "Failed to delete existing asset. Skipping file upload..."
rm -rf $file
continue
fi
else
echo "No $file file."
fi
echo "Uploading $file to release..."
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/zip" \
--data-binary @"$file" \
"https://uploads.github.com/repos/oneclickvirt/incus_images/releases/$release_id/assets?name=$(basename "$file")"
rm -rf $file
else
echo "No $file or less than 10 MB"
fi
done
done
1 change: 0 additions & 1 deletion .github/workflows/kali_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("kali")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/openwrt_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("openwrt")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/oralce_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("oracle")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rockylinux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("rockylinux")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ubuntu_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:

jobs:
ubuntu_x86_64_images:
runs-on: self-hosted
# runs-on: ubuntu-latest
# runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

Expand All @@ -24,7 +24,6 @@ jobs:
- name: Build and Upload Images
run: |
distros=("ubuntu")
# ("debian" "ubuntu" "kali" "centos" "almalinux" "rockylinux" "alpine" "openwrt" "oracle" "archlinux")
for distro in "${distros[@]}"; do
zip_name_list=($(bash build_images.sh $distro false x86_64 | tail -n 1))
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')
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# incus_images

[![almalinux x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/almalinux_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/almalinux_x86_64.yml) [![alpine x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/alpine_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/alpine_x86_64.yml) [![archlinux x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/archlinux_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/archlinux_x86_64.yml) [![centos x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/centos_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/centos_x86_64.yml) [![debian x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/debian_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/debian_x86_64.yml) [![kali x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/kali_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/kali_x86_64.yml) [![openwrt x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/openwrt_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/openwrt_x86_64.yml) [![oralce x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/oralce_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/oralce_x86_64.yml) [![rockylinux x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/rockylinux_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/rockylinux_x86_64.yml) [![ubuntu x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/ubuntu_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/ubuntu_x86_64.yml) [![Clone yaml](https://github.com/oneclickvirt/incus_images/actions/workflows/clone_yaml.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/clone_yaml.yml)
[![almalinux x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/almalinux_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/almalinux_x86_64.yml) [![alpine x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/alpine_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/alpine_x86_64.yml) [![archlinux x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/archlinux_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/archlinux_x86_64.yml) [![centos x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/centos_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/centos_x86_64.yml) [![debian x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/debian_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/debian_x86_64.yml) [![kali x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/kali_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/kali_x86_64.yml) [![openwrt x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/openwrt_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/openwrt_x86_64.yml) [![oralce x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/oralce_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/oralce_x86_64.yml) [![rockylinux x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/rockylinux_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/rockylinux_x86_64.yml) [![ubuntu x86_64](https://github.com/oneclickvirt/incus_images/actions/workflows/ubuntu_x86_64.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/ubuntu_x86_64.yml) [![clone yaml](https://github.com/oneclickvirt/incus_images/actions/workflows/clone_yaml.yml/badge.svg)](https://github.com/oneclickvirt/incus_images/actions/workflows/clone_yaml.yml)

## 说明

Expand Down

0 comments on commit 2f0f7a0

Please sign in to comment.