Compare commits

...

8 Commits
latest ... main

Author SHA1 Message Date
04b6c5de6c
test ge-actions
Some checks failed
build and push image / Release (push) Failing after 2m3s
2024-08-25 13:29:13 +09:00
35a33a7ca6
add bc 2024-08-25 13:07:31 +09:00
862dca006b
fix actions 2024-08-04 08:12:07 +09:00
f396610305
fix gh 2024-03-06 07:46:34 +09:00
cd9472d18a
config podman 2024-03-06 07:21:52 +09:00
74c7d3b1bb
add podman 2024-03-06 07:17:13 +09:00
c3330a75d9
update readme 2024-03-06 03:11:31 +09:00
f1c3874ed2
add gitea actions
All checks were successful
Build and Push Image / Release (push) Successful in 11s
2024-03-05 23:32:36 +09:00
8 changed files with 120 additions and 34 deletions

View File

@ -1,9 +1,17 @@
name: Build and Push Image name: build and push image
on: [ push ]
on:
schedule:
- cron: '0 12 * * *'
push:
branches:
- main
paths:
- '!README.md'
env: env:
USERNAME: ai
TAG: latest TAG: latest
IMAGE_ID: aios
IMAGE_NAME: ${{ gitea.repository }} IMAGE_NAME: ${{ gitea.repository }}
APP_TOKEN: ${{ secrets.APP_TOKEN }} APP_TOKEN: ${{ secrets.APP_TOKEN }}
REGISTRY: localhost:8088 REGISTRY: localhost:8088
@ -13,13 +21,14 @@ jobs:
name: Release name: Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: archlinux image: syui/aios
options: --privileged options: --privileged
steps: steps:
- name: Initialize - name: Initialize
run: | run: |
pacman -Syuu --noconfirm base-devel archiso docker git pacman -Syuu --noconfirm base-devel archiso docker git curl
docker pull syui/aios docker pull syui/aios
docker tag syui/aios ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:latest docker tag syui/aios ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
echo "${{ env.APP_TOKEN }}" | docker login ${{ env.REGISTRY }} -u syui --password-stdin echo "${{ env.APP_TOKEN }}" | docker login ${{ env.REGISTRY }} -u syui --password-stdin
docker push ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:latest docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}

View File

@ -4,8 +4,6 @@ on:
push: push:
branches: branches:
- main - main
schedule:
- cron: "0 0 * * *"
permissions: permissions:
contents: write contents: write
@ -28,7 +26,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Initialize - name: Initialize
run: | run: |
pacman -Syuu --noconfirm base-devel archiso docker git nodejs pacman -Syuu --noconfirm base-devel archiso docker git nodejs bc
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 /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
@ -43,7 +41,9 @@ jobs:
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' 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'
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 '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/ tar -zcvf aios-bootstrap.tar.gz root.x86_64/

1
.gitignore vendored
View File

@ -1 +1,2 @@
.config/ai .config/ai
**.DS_Store

100
README.md
View File

@ -1,34 +1,104 @@
## ai `os` # <img src="./icon/ai.png" width="30"> ai `os`
<img src="./icon/ai.png" width="100"> `aios` is a simple linux distribution based on `archlinux`.
- name : ai os |rule|var|
- image : [aios-bootstrap.tar.gz](https://github.com/syui/aios/releases/tag/latest) |---|---|
- 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 syui/aios ai $ docker run -it git.syui.ai/ai/os ai
``` ```
> Dockerfile ## link
|host|command|url|
|---|---|---|
|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
FROM syui/aios # https://gitlab.archlinux.org/archlinux
$ git clone https://gitlab.archlinux.org/archlinux/archiso
``` ```
- https://hub.docker.com/r/syui/aios ## docker
### github
```sh ```sh
# https://git.syui.ai/ai/-/packages/container/os
$ 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 $ docker run -it ghcr.io/syui/aios ai
``` ```
- https://github.com/users/syui/packages/container/package/aios ## token
### link |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
$ podman pull aios
$ podman machine init
$ podman machine start
```
https://github.com/containers/shortnames
> /etc/containers/registries.conf.d/ai.conf
>
> ~/.config/containers/registries.conf
```sh
unqualified-search-registries = ['docker.io', 'git.syui.ai', '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://git.syui.ai/ai/os
- https://github.com/syui/aios - https://github.com/syui/aios

View File

@ -1,5 +1,5 @@
#!/bin/zsh #!/bin/zsh
pacman -Syuu --noconfirm base-devel archiso docker git nodejs pacman -Syuu --noconfirm base-devel archiso docker git nodejs bc
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 /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
@ -14,7 +14,9 @@ Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' >> ./root.x86_64/etc/pa
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' 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'
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 '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/ tar -zcvf aios-bootstrap.tar.gz root.x86_64/

4
cfg/ai.conf Normal file
View File

@ -0,0 +1,4 @@
unqualified-search-registries = ['docker.io', 'git.syui.ai', 'ghcr.io']
[aliases]
"aios" = "git.syui.ai/ai/os"

View File

@ -4,8 +4,6 @@ on:
push: push:
branches: branches:
- main - main
schedule:
- cron: "0 0 * * *"
permissions: permissions:
contents: write contents: write
@ -28,7 +26,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Initialize - name: Initialize
run: | run: |
pacman -Syuu --noconfirm base-devel archiso docker git nodejs pacman -Syuu --noconfirm base-devel archiso docker git nodejs bc
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 /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
@ -43,7 +41,9 @@ jobs:
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' 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'
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 '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/ tar -zcvf aios-bootstrap.tar.gz root.x86_64/

View File

@ -9,8 +9,6 @@ on:
push: push:
branches: branches:
- main - main
schedule:
- cron: "0 0 * * *"
permissions: permissions:
contents: write contents: write
@ -69,3 +67,5 @@ echo '#!/bin/zsh' >! $dd/build.zsh
echo $yml_b >> $dd/build.zsh echo $yml_b >> $dd/build.zsh
cat $dd/build.zsh cat $dd/build.zsh
cp -rf $dd/cfg/gh-actions.yml $dd/.github/workflows/release.yml