Compare commits
4 Commits
main
...
dab6f6dfa2
Author | SHA1 | Date | |
---|---|---|---|
dab6f6dfa2
|
|||
fe811ac2d9
|
|||
8ac1ac1597
|
|||
1f01f6b0e9
|
@ -1,6 +0,0 @@
|
|||||||
# https://github.com/containers/shortnames
|
|
||||||
# ~/.config/containers/registries.conf.d/ai.conf
|
|
||||||
unqualified-search-registries=["git.syui.ai", "docker.io", "ghcr.io"]
|
|
||||||
|
|
||||||
[aliases]
|
|
||||||
"aios"="git.syui.ai/ai/os"
|
|
@ -1,30 +0,0 @@
|
|||||||
name: build and push image
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *'
|
|
||||||
push:
|
|
||||||
|
|
||||||
env:
|
|
||||||
TAG: latest
|
|
||||||
IMAGE_ID: aios
|
|
||||||
IMAGE_NAME: ${{ gitea.repository }}
|
|
||||||
APP_TOKEN: ${{ secrets.APP_TOKEN }}
|
|
||||||
REGISTRY: localhost:8088
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
name: Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ghcr.io/syui/aios
|
|
||||||
options: --privileged
|
|
||||||
steps:
|
|
||||||
- name: Initialize
|
|
||||||
run: |
|
|
||||||
pacman -Syuu --noconfirm base-devel archiso docker git curl
|
|
||||||
docker pull ghcr.io/syui/aios
|
|
||||||
docker tag syui/aios ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
|
||||||
echo "${{ env.APP_TOKEN }}" | docker login ${{ env.REGISTRY }} -u syui --password-stdin
|
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
|
||||||
|
|
67
.github/workflows/release.yml
vendored
67
.github/workflows/release.yml
vendored
@ -1,72 +1,41 @@
|
|||||||
name: release
|
name: release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- 'v*'
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
env:
|
|
||||||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.APP_TOKEN }}
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: archlinux
|
image: archlinux:latest
|
||||||
options: --privileged
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Initialize
|
- name: Initialize
|
||||||
|
env:
|
||||||
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
pacman -Syuu --noconfirm base-devel archiso docker git nodejs bc
|
pacman -Syuu --noconfirm base-devel archiso docker
|
||||||
git clone https://gitlab.archlinux.org/archlinux/archiso
|
./build.zsh gh
|
||||||
cp -rf ./cfg/profiledef.sh /usr/share/archiso/configs/releng/
|
mv *.tar.gz ./aios-bootstrap.tar.gz
|
||||||
cp -rf ./cfg/profiledef.sh ./archiso/configs/releng/profiledef.sh
|
systemctl start docker
|
||||||
cp -rf ./cfg/profiledef.sh ./archiso/configs/baseline/profiledef.sh
|
docker login -u=$DOCKER_USER -p=$DOCKER_PASSWORD
|
||||||
cp -rf ./scpt/mkarchiso ./archiso/archiso/mkarchiso
|
tar -C ./root.x86_64 -c . | docker import - syui/aios
|
||||||
./archiso/archiso/mkarchiso -v -o ./ ./archiso/configs/releng/
|
docker push syui/aios
|
||||||
tar xf aios-bootstrap*.tar.gz
|
|
||||||
mkdir -p root.x86_64/var/lib/machines/arch
|
|
||||||
pacstrap -c root.x86_64/var/lib/machines/arch base
|
|
||||||
echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch
|
|
||||||
Server = 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 go nodejs docker podman bc'
|
|
||||||
arch-chroot root.x86_64 /bin/sh -c 'mkdir -p /etc/containers/registries.conf.d'
|
|
||||||
arch-chroot root.x86_64 /bin/sh -c 'curl -sL -o /etc/containers/registries.conf.d/ai.conf https://git.syui.ai/ai/os/raw/branch/main/cfg/ai.conf'
|
|
||||||
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/
|
|
||||||
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
|
- name: Create new release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: latest
|
name: Release latest
|
||||||
tag_name: latest
|
tag_name: latest
|
||||||
files:
|
files:
|
||||||
aios-bootstrap.tar.gz
|
aios-bootstrap.tar.gz
|
||||||
|
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
|||||||
.config/ai
|
.config/ai
|
||||||
**.DS_Store
|
|
||||||
|
131
README.md
131
README.md
@ -1,110 +1,59 @@
|
|||||||
# <img src="./icon/ai.png" width="30"> ai `os`
|
## ai `os`
|
||||||
|
|
||||||
`aios` is a simple linux distribution based on `archlinux`.
|
<img src="./icon/ai.png" width="100">
|
||||||
|
|
||||||
|rule|var|
|
- name : ai os
|
||||||
|---|---|
|
- base : [archlinux](https://gitlab.archlinux.org/archlinux)
|
||||||
|name|ai os|
|
|
||||||
|code|aios|
|
### docker
|
||||||
|id|ai|
|
|
||||||
|container|[git.syui.ai/ai/os](https://git.syui.ai/ai/-/packages/container/os/latest)|
|
|
||||||
|image|[aios-bootstrap.tar.gz](https://github.com/syui/aios/releases/download/latest/aios-bootstrap.tar.gz)|
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ docker run -it git.syui.ai/ai/os ai
|
$ docker run --rm syui/aios ai
|
||||||
```
|
```
|
||||||
|
|
||||||
## link
|
### archiso
|
||||||
|
|
||||||
|host|command|url|
|
- [profile.rst](https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/docs/README.profile.rst)
|
||||||
|---|---|---|
|
|
||||||
|docker|syui/aios|https://hub.docker.com/r/syui/aios|
|
|
||||||
|github|ghcr.io/syui/aios|https://github.com/users/syui/packages/container/package/aios|
|
|
||||||
|syui|git.syui.ai/ai/os|https://git.syui.ai/ai/-/packages/container/os|
|
|
||||||
|
|
||||||
## base
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# https://gitlab.archlinux.org/archlinux
|
$ pacman -S archiso
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git clone https://git.syui.ai/ai/os
|
||||||
|
$ cd os
|
||||||
|
$ git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
|
||||||
$ git clone https://gitlab.archlinux.org/archlinux/archiso
|
$ git clone https://gitlab.archlinux.org/archlinux/archiso
|
||||||
|
|
||||||
|
$ vim ./archiso/configs/releng/profiledef.sh
|
||||||
|
|
||||||
|
$ mkarchiso -v -o ./ ./archiso/configs/releng
|
||||||
```
|
```
|
||||||
|
|
||||||
## docker
|
### system
|
||||||
|
|
||||||
|
> ./archiso/configs/releng/profiledef.sh
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# https://git.syui.ai/ai/-/packages/container/os
|
buildmodes=('bootstrap')
|
||||||
$ docker run -it git.syui.ai/ai/os ai
|
|
||||||
|
|
||||||
# https://hub.docker.com/r/syui/aios
|
|
||||||
$ docekr run -it syui/aios ai
|
|
||||||
|
|
||||||
# https://github.com/users/syui/packages/container/package/aios
|
|
||||||
$ docker run -it ghcr.io/syui/aios ai
|
|
||||||
```
|
|
||||||
|
|
||||||
## token
|
|
||||||
|
|
||||||
|env|body|
|
|
||||||
|---|---|
|
|
||||||
|${{ github.repository }}|syui/aios|
|
|
||||||
|${{ secrets.DOCKER_USERNAME }}|syui|
|
|
||||||
|${{ secrets.DOCKER_TOKEN }}|[token](https://matsuand.github.io/docs.docker.jp.onthefly/docker-hub/access-tokens/)|
|
|
||||||
|${{ secrets.APP_TOKEN }}|[token](https://docs.github.com/ja/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens), pacakge|
|
|
||||||
|
|
||||||
## podman
|
|
||||||
|
|
||||||
```sh
|
|
||||||
if [ ! -d ~/ai/os/.git ];then
|
|
||||||
mkdir -p ~/ai
|
|
||||||
git clone https://git.syui.ai/ai/os ~/ai/os
|
|
||||||
fi
|
|
||||||
if [ ! -d ~/.config/containers/registries.conf.d ];then
|
|
||||||
mkdir -p ~/.config/containers/registries.conf.d
|
|
||||||
fi
|
|
||||||
ln -s ~/ai/os/.config/containers/registries.conf.d/ai.conf ~/.config/containers/registries.conf.d/ai.conf
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ podman pull aios
|
$ 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
|
||||||
|
---
|
||||||
|
$ pacman -S base base-devel linux vim git zsh rust
|
||||||
|
$ pacman-key --init
|
||||||
|
$ pacman-key --populate archlinux
|
||||||
|
$ exit
|
||||||
|
---
|
||||||
|
$ tar -C root.x86_64 -c . | docker import - syui/aios
|
||||||
|
$ docker images
|
||||||
|
|
||||||
|
$ docker run --rm syui/aios cargo version
|
||||||
|
cargo 1.75.0
|
||||||
```
|
```
|
||||||
|
|
||||||
> ~/.config/containers/registries.conf.d/ai.conf
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# https://github.com/containers/shortnames
|
|
||||||
# ~/.config/containers/registries.conf.d/ai.conf
|
|
||||||
unqualified-search-registries = ['git.syui.ai', 'docker.io', 'ghcr.io']
|
|
||||||
|
|
||||||
[aliases]
|
|
||||||
"aios" = "git.syui.ai/ai/os"
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ podman pull aios
|
|
||||||
Resolved "aios" as an alias (/etc/containers/registries.conf.d/ai.conf)
|
|
||||||
Trying to pull git.syui.ai/ai/os:latest...
|
|
||||||
Getting image source signatures
|
|
||||||
Copying blob c7e55fecf0be [====================>-----------------] 917.4MiB / 1.7GiB
|
|
||||||
```
|
|
||||||
|
|
||||||
## cron
|
|
||||||
|
|
||||||
stop
|
|
||||||
|
|
||||||
```sh
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
```
|
|
||||||
|
|
||||||
## update action
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ vim build.zszh
|
|
||||||
$ ./scpt/gh-actions.zsh
|
|
||||||
```
|
|
||||||
|
|
||||||
## link
|
|
||||||
|
|
||||||
- https://git.syui.ai/ai/os
|
|
||||||
- https://github.com/syui/aios
|
|
||||||
|
|
||||||
|
1
archiso
Submodule
1
archiso
Submodule
Submodule archiso added at 1f65b695d3
1
archlinux-docker
Submodule
1
archlinux-docker
Submodule
Submodule archlinux-docker added at 98cd79111d
75
build.zsh
75
build.zsh
@ -1,22 +1,65 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
pacman -Syuu --noconfirm base-devel archiso docker git nodejs bc
|
|
||||||
|
d=${0:a:h}
|
||||||
|
case $1 in
|
||||||
|
bsae)
|
||||||
|
a=baseline
|
||||||
|
docker=true
|
||||||
|
;;
|
||||||
|
gh)
|
||||||
|
a=releng
|
||||||
|
docker=false
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
a=releng
|
||||||
|
docker=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
if ! ls $d/*.tar.gz;then
|
||||||
|
rm -rf $d/*.tar.gz
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $d/work ];then
|
||||||
|
rm -rf $d/work
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $d/root.x86_64 ];then
|
||||||
|
rm -rf $d/root.x86_64
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $d/archiso ];then
|
||||||
|
rm -rf $d/archiso
|
||||||
|
fi
|
||||||
|
|
||||||
git clone https://gitlab.archlinux.org/archlinux/archiso
|
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
|
# rm -rf $d/archlinux-docker
|
||||||
cp -rf ./cfg/profiledef.sh ./archiso/configs/baseline/profiledef.sh
|
# git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
|
||||||
cp -rf ./scpt/mkarchiso ./archiso/archiso/mkarchiso
|
|
||||||
./archiso/archiso/mkarchiso -v -o ./ ./archiso/configs/releng/
|
cp -rf $d/cfg/profiledef.sh $d/archiso/configs/$a/profiledef.sh
|
||||||
tar xf aios-bootstrap*.tar.gz
|
cp -rf $d/scpt/mkarchiso $d/archiso/archiso/mkarchiso
|
||||||
mkdir -p root.x86_64/var/lib/machines/arch
|
|
||||||
pacstrap -c root.x86_64/var/lib/machines/arch base
|
$d/archiso/archiso/mkarchiso -v -o $d/ $d/archiso/configs/releng
|
||||||
echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch
|
|
||||||
Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' >> ./root.x86_64/etc/pacman.d/mirrorlist
|
if [ ! -d $d/root.x86_64 ];then
|
||||||
|
tar xf $d/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
|
||||||
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'
|
||||||
arch-chroot root.x86_64 /bin/sh -c 'pacman-key --populate archlinux'
|
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 go nodejs docker podman bc'
|
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 'mkdir -p /etc/containers/registries.conf.d'
|
|
||||||
arch-chroot root.x86_64 /bin/sh -c 'curl -sL -o /etc/containers/registries.conf.d/ai.conf https://git.syui.ai/ai/os/raw/branch/main/cfg/ai.conf'
|
|
||||||
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'
|
||||||
tar -zcvf aios-bootstrap.tar.gz root.x86_64/
|
|
||||||
|
# docker image
|
||||||
|
if [ $docker = true ];then
|
||||||
|
systemctl start docker
|
||||||
|
tar -C $d/root.x86_64 -c . | docker import - syui/aios
|
||||||
|
|
||||||
|
docker images -a
|
||||||
|
docker run --rm syui/aios ai
|
||||||
|
docker push syui/aios
|
||||||
|
fi
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# https://github.com/containers/shortnames
|
|
||||||
# ~/.config/containers/registries.conf.d/ai.conf
|
|
||||||
unqualified-search-registries = ['git.syui.ai', 'docker.io', 'ghcr.io']
|
|
||||||
|
|
||||||
[aliases]
|
|
||||||
"aios" = "git.syui.ai/ai/os"
|
|
@ -1,72 +0,0 @@
|
|||||||
name: release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
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: |
|
|
||||||
pacman -Syuu --noconfirm base-devel archiso docker git nodejs bc
|
|
||||||
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
|
|
||||||
mkdir -p root.x86_64/var/lib/machines/arch
|
|
||||||
pacstrap -c root.x86_64/var/lib/machines/arch base
|
|
||||||
echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch
|
|
||||||
Server = 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 go nodejs docker podman bc'
|
|
||||||
arch-chroot root.x86_64 /bin/sh -c 'mkdir -p /etc/containers/registries.conf.d'
|
|
||||||
arch-chroot root.x86_64 /bin/sh -c 'curl -sL -o /etc/containers/registries.conf.d/ai.conf https://git.syui.ai/ai/os/raw/branch/main/cfg/ai.conf'
|
|
||||||
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/
|
|
||||||
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
|
|
||||||
|
|
125
docs/wiki.md
125
docs/wiki.md
@ -1,125 +0,0 @@
|
|||||||
### archiso
|
|
||||||
|
|
||||||
- [profile.rst](https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/docs/README.profile.rst)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ pacman -S archiso
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ git clone https://git.syui.ai/ai/os
|
|
||||||
$ cd os
|
|
||||||
$ git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
|
|
||||||
$ git clone https://gitlab.archlinux.org/archlinux/archiso
|
|
||||||
|
|
||||||
$ vim ./archiso/configs/releng/profiledef.sh
|
|
||||||
|
|
||||||
$ mkarchiso -v -o ./ ./archiso/configs/releng
|
|
||||||
```
|
|
||||||
|
|
||||||
### system
|
|
||||||
|
|
||||||
> ./archiso/configs/releng/profiledef.sh
|
|
||||||
|
|
||||||
```sh
|
|
||||||
buildmodes=('bootstrap')
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ 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
|
|
||||||
---
|
|
||||||
$ pacman -S base base-devel linux vim git zsh rust
|
|
||||||
$ pacman-key --init
|
|
||||||
$ pacman-key --populate archlinux
|
|
||||||
$ exit
|
|
||||||
---
|
|
||||||
$ tar -C root.x86_64 -c . | docker import - syui/aios
|
|
||||||
$ docker images
|
|
||||||
|
|
||||||
$ docker run --rm syui/aios cargo version
|
|
||||||
cargo 1.75.0
|
|
||||||
```
|
|
||||||
|
|
||||||
### gh-actions
|
|
||||||
|
|
||||||
[.github/workflows/push.yml](https://docs.github.com/en/enterprise-cloud@latest/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions)
|
|
||||||
|
|
||||||
```yml
|
|
||||||
name: Demo Push
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- seed
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: ghtoken_product_demo
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
push:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build image
|
|
||||||
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
|
|
||||||
- name: Log in to registry
|
|
||||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
|
|
||||||
- name: Push image
|
|
||||||
run: |
|
|
||||||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
|
|
||||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
|
||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
|
||||||
[ "$VERSION" == "main" ] && VERSION=latest
|
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
|
||||||
echo VERSION=$VERSION
|
|
||||||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
|
|
||||||
docker push $IMAGE_ID:$VERSION
|
|
||||||
```
|
|
||||||
|
|
||||||
### github-token
|
|
||||||
|
|
||||||
```yml
|
|
||||||
env:
|
|
||||||
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: 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 }}
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# make gh-actions
|
|
||||||
$ vim ./build.zsh
|
|
||||||
$ ./scpt/gh-actions.zsh
|
|
||||||
```
|
|
@ -1,71 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
d=${0:a:h}
|
|
||||||
dd=${0:a:h:h}
|
|
||||||
|
|
||||||
yml_a='name: release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
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'`
|
|
||||||
|
|
||||||
echo $yml_a >! $dd/cfg/gh-actions.yml
|
|
||||||
echo $yml_b|sed 's/^/ /g' >> $dd/cfg/gh-actions.yml
|
|
||||||
echo $yml_c >> $dd/cfg/gh-actions.yml
|
|
||||||
cat $dd/cfg/gh-actions.yml
|
|
||||||
|
|
||||||
echo '#!/bin/zsh' >! $dd/build.zsh
|
|
||||||
echo $yml_b >> $dd/build.zsh
|
|
||||||
cat $dd/build.zsh
|
|
||||||
|
|
||||||
cp -rf $dd/cfg/gh-actions.yml $dd/.github/workflows/release.yml
|
|
||||||
|
|
Reference in New Issue
Block a user