This commit is contained in:
syui 2024-02-13 10:09:13 +09:00
parent 2056dcb601
commit 23a90cec83
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
4 changed files with 87 additions and 38 deletions

View File

@ -5,7 +5,7 @@ on:
branches: branches:
- main - main
schedule: schedule:
- cron: '0 0 * * *' - cron: "0 0 * * *"
permissions: permissions:
contents: write contents: write

View File

@ -1,40 +1,11 @@
#!/bin/zsh #!/bin/zsh
d=${0:a:h}
cd $d
if ! ls ./*.tar.gz;then
rm -rf ./*.tar.gz
fi
if [ -d ./work ];then
rm -rf ./work
fi
if [ -d ./root.x86_64 ];then
rm -rf ./root.x86_64
fi
if [ -d ./archiso ];then
rm -rf ./archiso
fi
git clone https://gitlab.archlinux.org/archlinux/archiso git clone https://gitlab.archlinux.org/archlinux/archiso
# rm -rf $d/archlinux-docker
# git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
cp -rf ./cfg/profiledef.sh /usr/share/archiso/configs/releng/ cp -rf ./cfg/profiledef.sh /usr/share/archiso/configs/releng/
cp -rf ./cfg/profiledef.sh ./archiso/configs/releng/profiledef.sh cp -rf ./cfg/profiledef.sh ./archiso/configs/releng/profiledef.sh
cp -rf ./cfg/profiledef.sh ./archiso/configs/baseline/profiledef.sh cp -rf ./cfg/profiledef.sh ./archiso/configs/baseline/profiledef.sh
cp -rf ./scpt/mkarchiso ./archiso/archiso/mkarchiso cp -rf ./scpt/mkarchiso ./archiso/archiso/mkarchiso
./archiso/archiso/mkarchiso -v -o ./ ./archiso/configs/releng ./archiso/archiso/mkarchiso -v -o ./ ./archiso/configs/releng
if [ ! -d ./root.x86_64 ];then
tar xf ./aios-bootstrap*.tar.gz tar xf ./aios-bootstrap*.tar.gz
fi
echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch\nServer = https://geo.mirror.pkgbuild.com/$repo/os/$arch' >> ./root.x86_64/etc/pacman.d/mirrorlist echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch\nServer = https://geo.mirror.pkgbuild.com/$repo/os/$arch' >> ./root.x86_64/etc/pacman.d/mirrorlist
sed -i s/CheckSpace/#CheckeSpace/ root.x86_64/etc/pacman.conf sed -i s/CheckSpace/#CheckeSpace/ root.x86_64/etc/pacman.conf
arch-chroot root.x86_64 /bin/sh -c 'pacman-key --init' arch-chroot root.x86_64 /bin/sh -c 'pacman-key --init'
@ -42,11 +13,5 @@ arch-chroot root.x86_64 /bin/sh -c 'pacman-key --populate archlinux'
arch-chroot root.x86_64 /bin/sh -c 'pacman -Syu --noconfirm base base-devel linux vim git zsh rust openssh openssl jq' arch-chroot root.x86_64 /bin/sh -c 'pacman -Syu --noconfirm base base-devel linux vim git zsh rust openssh openssl jq'
arch-chroot root.x86_64 /bin/sh -c 'chsh -s /bin/zsh' arch-chroot root.x86_64 /bin/sh -c 'chsh -s /bin/zsh'
arch-chroot root.x86_64 /bin/sh -c 'git clone https://git.syui.ai/ai/bot && cd bot && cargo build && cp -rf ./target/debug/ai /bin/ && ai ai' arch-chroot root.x86_64 /bin/sh -c 'git clone https://git.syui.ai/ai/bot && cd bot && cargo build && cp -rf ./target/debug/ai /bin/ && ai ai'
systemctl start docker
tar -C ./root.x86_64 -c . | docker import - syui/aios tar -C ./root.x86_64 -c . | docker import - syui/aios
tar -zcvf aios-bootstrap.tar.gz root.x86_64/
docker images -a
docker run --rm syui/aios ai
#arch-chroot root.x86_64
#docker push syui/aios

16
cfg/build.sh Normal file
View File

@ -0,0 +1,16 @@
pacman -Syuu --noconfirm base-devel archiso docker git
git clone https://gitlab.archlinux.org/archlinux/archiso
cp -rf ./cfg/profiledef.sh /usr/share/archiso/configs/releng/
cp -rf ./cfg/profiledef.sh ./archiso/configs/releng/profiledef.sh
cp -rf ./cfg/profiledef.sh ./archiso/configs/baseline/profiledef.sh
cp -rf ./scpt/mkarchiso ./archiso/archiso/mkarchiso
./archiso/archiso/mkarchiso -v -o ./ ./archiso/configs/releng/
tar xf aios-bootstrap*.tar.gz
echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch\nServer = https://geo.mirror.pkgbuild.com/$repo/os/$arch' >> ./root.x86_64/etc/pacman.d/mirrorlist
sed -i s/CheckSpace/#CheckeSpace/ root.x86_64/etc/pacman.conf
arch-chroot root.x86_64 /bin/sh -c 'pacman-key --init'
arch-chroot root.x86_64 /bin/sh -c 'pacman-key --populate archlinux'
arch-chroot root.x86_64 /bin/sh -c 'pacman -Syu --noconfirm base base-devel linux vim git zsh rust openssh openssl jq'
arch-chroot root.x86_64 /bin/sh -c 'chsh -s /bin/zsh'
arch-chroot root.x86_64 /bin/sh -c 'git clone https://git.syui.ai/ai/bot && cd bot && cargo build && cp -rf ./target/debug/ai /bin/ && ai ai'
tar -zcvf aios-bootstrap.tar.gz root.x86_64/

68
scpt/gp-pages.zsh Executable file
View File

@ -0,0 +1,68 @@
#!/bin/zsh
d=${0:a:h}
dd=${0:a:h:h}
yml_a='name: release
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
permissions:
contents: write
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
IMAGE_NAME: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.APP_TOKEN }}
REGISTRY: ghcr.io
jobs:
release:
name: Release
runs-on: ubuntu-latest
container:
image: archlinux
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize
run: |'
yml_c='
tar -C ./root.x86_64 -c . | docker import - ${{ env.IMAGE_NAME }}
echo "${{ env.DOCKER_TOKEN }}" | docker login -u syui --password-stdin
docker push ${{ env.IMAGE_NAME }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ env.GITHUB_TOKEN }}
- name: github container registry
run: |
docker tag ${{ env.IMAGE_NAME }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Create new release
uses: softprops/action-gh-release@v1
with:
name: latest
tag_name: latest
files:
aios-bootstrap.tar.gz
'
#yml_b=`cat $dd/build.zsh |sed '1d'`
yml_b=`cat $dd/cfg/build.sh`
echo $yml_a
echo $yml_b
echo $yml_c