diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 12d2b6c..f86513b 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -18,7 +18,6 @@ jobs: strategy: matrix: arch: [amd64, arm64] - distro: [ubuntu, alpine] steps: - uses: actions/checkout@v4 @@ -38,8 +37,9 @@ jobs: PLATFORM="linux/${{ matrix.arch }}" echo "๐Ÿ—๏ธ Building ${PLATFORM} on native ${{ matrix.arch }} runner" - echo "๐Ÿ“ฆ Distribution: ${{ matrix.distro }}" + echo "๐Ÿ“ฆ Using Ubuntu 20.04 with depends system" echo "๐Ÿ“ฆ Monero Version: ${MONERO_VERSION}" + echo "๐Ÿ”— Static linking enabled" # ่ฎพ็ฝฎ BuildKit ไผ˜ๅŒ–ๅ‚ๆ•ฐ export BUILDKIT_PROGRESS=plain @@ -48,19 +48,35 @@ jobs: --platform ${PLATFORM} \ --build-arg MONERO_VERSION=${MONERO_VERSION} \ --output type=local,dest=./output \ - -f docker/Dockerfile.${{ matrix.distro }} . + -f docker/Dockerfile.ubuntu . + + - name: Verify static linking + run: | + DIR="./output/linux_${{ matrix.arch }}" + BINARY="${DIR}/mond" + + if [ ! -f "$BINARY" ]; then + echo "โŒ ไบŒ่ฟ›ๅˆถๆ–‡ไปถไธๅญ˜ๅœจ: $BINARY" + exit 1 + fi + + echo "๐Ÿ” ้ชŒ่ฏ้™ๆ€้“พๆŽฅ..." + if ldd "$BINARY" 2>&1 | grep -q "not a dynamic executable"; then + echo "โœ… ็บฏ้™ๆ€้“พๆŽฅ้ชŒ่ฏๆˆๅŠŸ" + else + echo "โŒ ้™ๆ€้“พๆŽฅ้ชŒ่ฏๅคฑ่ดฅ๏ผŒๅ‘็ŽฐๅŠจๆ€ๅบ“ไพ่ต–๏ผš" + ldd "$BINARY" || true + exit 1 + fi + + file "$BINARY" - name: Package and test run: | DIR="./output/linux_${{ matrix.arch }}" - - if [ ! -d "$DIR" ]; then - echo "โŒ ๆž„ๅปบ่พ“ๅ‡บ็›ฎๅฝ•ไธๅญ˜ๅœจ: $DIR" - exit 1 - fi - VERSION=${MONERO_VERSION#v} # ็งป้™คๅ‰ๅฏผ v - TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-${{ matrix.distro }}-${VERSION}.tar.gz" + TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-ubuntu-${VERSION}.tar.gz" + tar -czf "${TARGZ}" -C "$DIR" . echo "๐Ÿ“ฆ Created package: ${TARGZ}" @@ -72,7 +88,6 @@ jobs: rm -rf test - name: Build Debian package - if: matrix.distro == 'ubuntu' run: | # ๅฎ‰่ฃ… dpkg-deb๏ผˆๅฆ‚ๆžœ้œ€่ฆ๏ผ‰ sudo apt-get update && sudo apt-get install -y dpkg-dev @@ -88,7 +103,7 @@ jobs: - uses: https://github.com/ChristopherHX/gitea-upload-artifact@v4 with: - name: binaries-${{ matrix.arch }}-${{ matrix.distro }} + name: binaries-${{ matrix.arch }} path: | *.tar.gz *.deb @@ -168,7 +183,7 @@ jobs: echo "๐Ÿ“ ็”Ÿๆˆ Release..." export REGISTRY OWNER TAG - RELEASE_DATA=$(python3 -c 'import json,glob,os;r=os.environ["REGISTRY"];o=os.environ["OWNER"];p=os.environ["PRODUCT_NAME"];t=os.environ["TAG"];b=["## Release "+t,"","Mond is a customized build of Monero daemon (monerod).","","### ๐Ÿ“ฅ Download Methods","","#### Method 1: Direct Download (Recommended)","","Click on the file names in the **Assets** section below to download directly.","","#### Method 2: Generic Package Registry",""]+[f"- [`{f}`](https://{r}/api/packages/{o}/generic/{p}/{t}/{f})" for f in sorted(glob.glob("*.tar.gz"))]+["","#### Method 3: Debian Repository","","**Debian 12 (bookworm):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian bookworm main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```","","**Debian 13 (trixie):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian trixie main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```"];print(json.dumps({"tag_name":t,"name":f"Release {t}","body":"\n".join(b),"draft":False,"prerelease":False}))') + RELEASE_DATA=$(python3 -c 'import json,glob,os;r=os.environ["REGISTRY"];o=os.environ["OWNER"];p=os.environ["PRODUCT_NAME"];t=os.environ["TAG"];b=["## Release "+t,"","Mond is a customized build of Monero daemon (monerod).","","### โœจ Key Features","","- ๐Ÿ”— **Pure Static Linking** - No dependencies required, runs on any Linux system","- ๐Ÿ—๏ธ **Multi-Architecture** - Native support for AMD64 and ARM64","- ๐Ÿ“ฆ **Built with Official depends System** - Using Monero official build system for reliability","","### ๐Ÿ“ฅ Download Methods","","#### Method 1: Direct Download (Recommended)","","Click on the file names in the **Assets** section below to download directly.","","**Available Packages:**",""]+[f"- [`{f}`](https://{r}/api/packages/{o}/generic/{p}/{t}/{f})" for f in sorted(glob.glob("*.tar.gz"))]+["","#### Method 2: Generic Package Registry","","Download via command line:",""]+[f"```bash\nwget https://{r}/api/packages/{o}/generic/{p}/{t}/{f}\n```" for f in sorted(glob.glob("*.tar.gz"))[:1]]+["","#### Method 3: Debian Repository","","**Debian 12 (Bookworm):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian bookworm main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```","","**Debian 13 (Trixie):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian trixie main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```","","### ๐Ÿ” Verify Static Linking","","After downloading, verify the binary is statically linked:","","```bash","ldd mond","# Expected output: \"not a dynamic executable\"","```"];print(json.dumps({"tag_name":t,"name":f"Release {t}","body":"\n".join(b),"draft":False,"prerelease":False}))') # ๅˆ›ๅปบ Release echo ""