Skip to content

Commit 45b1af8

Browse files
committed
up
1 parent 46053eb commit 45b1af8

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: AARCH64
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
check_update:
11+
name: Check update
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check version
15+
id: check_version
16+
run: |
17+
local_version=$(curl -L --header 'authorization: Bearer ${{ github.token }}' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
18+
remote_version=$(curl -L https://api.github.com/repos/rurioss/rurima-aio/releases/latest | jq -r .tag_name)
19+
echo local_version=$local_version | tee -a $GITHUB_OUTPUT
20+
echo remote_version=$remote_version | tee -a $GITHUB_OUTPUT
21+
outputs:
22+
local_version: ${{ steps.check_version.outputs.local_version }}
23+
remote_version: ${{ steps.check_version.outputs.remote_version }}
24+
build:
25+
name: Build
26+
needs: check_update
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
30+
steps:
31+
- name: Set env
32+
run: |
33+
echo remote_version=${{ needs.check_update.outputs.remote_version }} | tee -a $GITHUB_ENV
34+
echo build_time=$(TZ=Asia/Shanghai date '+%Y%m%d%H%M') | tee -a $GITHUB_ENV
35+
- uses: actions/checkout@v4
36+
- uses: uraimo/run-on-arch-action@v2
37+
name: Install packages
38+
id: runcmd
39+
with:
40+
arch: aarch64
41+
distro: ubuntu_latest
42+
run: |
43+
bash build/chroot-alpine.sh
44+
- name: Release
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
tag_name: ${{ env.remote_version }}
48+
body: |
49+
Build time: ${{ env.build_time }}
50+
prerelease: false
51+
files: |
52+
/home/runner/work/rurima-aio/rurima-aio/aarch64.tar

build/chroot-alpine.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apt update
2+
apt install -y sudo
3+
sudo apt install -y git wget
4+
yes|sudo apt install --no-install-recommends -y curl xz-utils \
5+
make \
6+
clang \
7+
libseccomp-dev \
8+
libcap-dev \
9+
libc6-dev \
10+
binutils
11+
git clone https://github.com/moe-hacker/rootfstool
12+
rootfstool/rootfstool d -d alpine -v edge
13+
mkdir alpine
14+
sudo tar -xvf rootfs.tar.xz -C alpine
15+
git clone https://github.com/moe-hacker/ruri
16+
cd ruri
17+
cc -Wl,--gc-sections -static src/*.c src/easteregg/*.c -o ruri -lcap -lseccomp -lpthread
18+
cd ..
19+
cat << 'EOF' | sudo tee alpine/build.sh
20+
#!/bin/sh
21+
rm /etc/resolv.conf
22+
echo "nameserver 1.1.1.1" > /etc/resolv.conf
23+
echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
24+
apk update
25+
apk add bash curl wget sudo coreutils clang make git
26+
apk add wget make clang git xz-dev libintl libbsd-static libsemanage-dev libselinux-utils libselinux-static xz-libs zlib zlib-static libselinux-dev linux-headers libssl3 libbsd libbsd-dev gettext-libs gettext-static gettext-dev gettext python3 build-base openssl-misc openssl-libs-static openssl zlib-dev xz-dev openssl-dev automake libtool bison flex gettext autoconf gettext sqlite sqlite-dev pcre-dev wget texinfo docbook-xsl libxslt docbook2x musl-dev gettext gettext-asprintf gettext-dbg gettext-dev gettext-doc gettext-envsubst gettext-lang gettext-libs gettext-static
27+
apk add upx
28+
git clone https://github.com/rurioss/rurima-aio
29+
cd rurima-aio
30+
make
31+
mv out rurima-aio
32+
tar -cvf /$(uname -m).tar rurima-aio
33+
EOF
34+
sudo chmod +x alpine/build.sh
35+
sudo ./ruri/ruri ./alpine /bin/sh /build.sh
36+
cp alpine/$(uname -m).tar .

0 commit comments

Comments
 (0)