From cf08fc3e8e5b00c260affecbe17138dc311233bd Mon Sep 17 00:00:00 2001 From: syui Date: Tue, 5 Mar 2024 12:42:20 +0900 Subject: [PATCH] add gitea actions --- .gitea/workflows/release.yml | 9 ++++----- .github/workflows/release.yml | 2 +- build.zsh | 2 +- cfg/gh-actions.yml | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index d41f645..df667a3 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -2,8 +2,8 @@ name: Build and Push Image on: [ push ] env: - USERNAME: ai TAG: latest + IMAGE_ID: aios IMAGE_NAME: ${{ gitea.repository }} APP_TOKEN: ${{ secrets.APP_TOKEN }} REGISTRY: localhost:8088 @@ -13,13 +13,12 @@ jobs: name: Release runs-on: ubuntu-latest container: - image: archlinux + image: syui/aios options: --privileged steps: - name: Initialize run: | - pacman -Syuu --noconfirm base-devel archiso docker git 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 - docker push ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:latest + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d1351b..b3aaeb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: 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' + 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' 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/ diff --git a/build.zsh b/build.zsh index 0853e2c..ac862b2 100755 --- a/build.zsh +++ b/build.zsh @@ -14,7 +14,7 @@ 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 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' +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' 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/ diff --git a/cfg/gh-actions.yml b/cfg/gh-actions.yml index 8d1351b..b3aaeb1 100644 --- a/cfg/gh-actions.yml +++ b/cfg/gh-actions.yml @@ -43,7 +43,7 @@ jobs: 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' + 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' 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/