chore(ci): add musl builds

This commit is contained in:
Alexander Medvedev
2026-08-25 15:32:07 +02:00
parent d8c7c23c0b
commit a2881a96fd
3 changed files with 72 additions and 46 deletions

View File

@@ -41,17 +41,41 @@ jobs:
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Install musl-tools (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Build Release
shell: bash
run: |
cargo build --verbose --release
if [ "${{ runner.os }}" == "Linux" ]; then
if [ "${{ runner.arch }}" == "X64" ]; then
TARGET="x86_64-unknown-linux-musl"
elif [ "${{ runner.arch }}" == "ARM64" ]; then
TARGET="aarch64-unknown-linux-musl"
fi
rustup target add "$TARGET"
cargo build --verbose --release --target "$TARGET"
fi
- name: Prepare artifacts
shell: bash
run: |
mkdir -p dist
EXT=""
if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi
cp "target/release/pumpkin$EXT" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}$EXT"
if [ "${{ runner.os }}" == "Linux" ]; then
if [ "${{ runner.arch }}" == "X64" ]; then
TARGET="x86_64-unknown-linux-musl"
elif [ "${{ runner.arch }}" == "ARM64" ]; then
TARGET="aarch64-unknown-linux-musl"
fi
cp "target/$TARGET/release/pumpkin" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}-musl"
fi
- name: Upload unsigned executable for SignPath (Windows only)
if: runner.os == 'Windows'

View File

@@ -28,7 +28,6 @@ jobs:
machete:
name: Detect unused dependencies
runs-on: ubuntu-latest
needs: [format]
strategy:
matrix:
toolchain:
@@ -42,7 +41,6 @@ jobs:
clippy_debug:
name: Run lints (debug)
runs-on: ubuntu-latest
needs: [machete]
strategy:
matrix:
toolchain:
@@ -59,7 +57,6 @@ jobs:
clippy_release:
name: Run lints (release)
runs-on: ubuntu-latest
needs: [machete]
strategy:
matrix:
toolchain:
@@ -76,7 +73,7 @@ jobs:
build_and_test:
name: Build project and test
runs-on: ${{ matrix.os }}
needs: [clippy_debug, clippy_release]
needs: [format, machete, clippy_debug, clippy_release]
strategy:
matrix:
os:
@@ -124,17 +121,41 @@ jobs:
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Install musl-tools (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Build Release
shell: bash
run: |
cargo build --verbose --release
if [ "${{ runner.os }}" == "Linux" ]; then
if [ "${{ runner.arch }}" == "X64" ]; then
TARGET="x86_64-unknown-linux-musl"
elif [ "${{ runner.arch }}" == "ARM64" ]; then
TARGET="aarch64-unknown-linux-musl"
fi
rustup target add "$TARGET"
cargo build --verbose --release --target "$TARGET"
fi
- name: Prepare artifacts
shell: bash
run: |
mkdir -p dist
EXT=""
if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi
cp "target/release/pumpkin$EXT" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}$EXT"
if [ "${{ runner.os }}" == "Linux" ]; then
if [ "${{ runner.arch }}" == "X64" ]; then
TARGET="x86_64-unknown-linux-musl"
elif [ "${{ runner.arch }}" == "ARM64" ]; then
TARGET="aarch64-unknown-linux-musl"
fi
cp "target/$TARGET/release/pumpkin" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}-musl"
fi
- name: Export executable
uses: actions/upload-artifact@v7
with:

View File

@@ -7,10 +7,11 @@
"exported_at": "2026-02-10T08:07:42+00:00",
"name": "Pumpkin",
"author": "lilalexmed@proton.me",
"description": "Pumpkin is a Minecraft server built entirely in Rust, offering a fast, efficient, and customizable experience. It prioritizes performance and player enjoyment while adhering to the core mechanics of the game. Requires around 4GB RAM to build, adjust docker.installer_limits.memory to a value of 4096 or above in your wing accordingly! For faster builds consider increasing docker.installer_limits.cpu as well.",
"description": "Pumpkin is a Minecraft server built entirely in Rust, offering a fast, efficient, and customizable experience. It prioritizes performance and player enjoyment while adhering to the core mechanics of the game.",
"features": null,
"docker_images": {
"Alpine": "ghcr.io\/pterodactyl\/yolks:alpine"
"Alpine": "ghcr.io\/pterodactyl\/yolks:alpine",
"Debian": "ghcr.io\/pterodactyl\/yolks:debian"
},
"file_denylist": [],
"startup": ".\/pumpkin",
@@ -22,8 +23,8 @@
},
"scripts": {
"installation": {
"script": "#!\/bin\/ash\r\nset -eux\r\n\r\napk add --no-cache musl-dev git\r\nmkdir -p \/mnt\/server\r\n\r\nREPO_URL=\"${GIT_URL:-https:\/\/github.com\/Pumpkin-MC\/Pumpkin.git}\"\r\n\r\nif [ -n \"$GIT_BRANCH\" ]; then\r\n git clone --depth 1 --single-branch --branch \"$GIT_BRANCH\" \"$REPO_URL\"\r\nelse\r\n git clone --depth 1 --single-branch \"$REPO_URL\"\r\nfi\r\n\r\ncd Pumpkin\r\n\r\nif [ -n \"$GIT_COMMIT\" ]; then\r\n git fetch --depth 1 origin \"$GIT_COMMIT\"\r\n git checkout \"$GIT_COMMIT\"\r\nfi\r\n\r\ngit submodule update --init --recursive --depth 1\r\n\r\n#export RUSTFLAGS=\"-C target-feature=-crt-static -C target-cpu=native\"\r\nexport CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS:-default}\r\n\r\nif [[ \"$BUILD_RELEASE\" == \"1\" || \"$BUILD_RELEASE\" == \"true\" ]]; then\r\n cargo build --release\r\n strip target\/release\/pumpkin\r\n cp target\/release\/pumpkin \/mnt\/server\/pumpkin\r\nelse\r\n cargo build\r\n cp target\/debug\/pumpkin \/mnt\/server\/pumpkin\r\nfi\r\n\r\n# Quickly start and kill server to generate config\r\ncd \/mnt\/server\r\ntimeout 1 .\/pumpkin",
"container": "docker.io\/rust:1-alpine3.21",
"script": "#!\/bin\/ash\r\nset -eux\r\n\r\napk add --no-cache curl jq\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nARCH=$(uname -m)\r\ncase \"$ARCH\" in\r\n x86_64|amd64)\r\n PUMPKIN_ARCH=\"X64\"\r\n ;;\r\n aarch64|arm64)\r\n PUMPKIN_ARCH=\"ARM64\"\r\n ;;\r\n *)\r\n echo \"Unsupported architecture: $ARCH\"\r\n exit 1\r\n ;;\r\nesac\r\n\r\nBINARY_NAME=\"pumpkin-${PUMPKIN_ARCH}-Linux-musl\"\r\n\r\nif [ -n \"${DOWNLOAD_URL:-}\" ]; then\r\n URL=\"$DOWNLOAD_URL\"\r\nelif [ \"${VERSION:-latest}\" = \"latest\" ]; then\r\n URL=\"https:\/\/github.com\/${GITHUB_PACKAGE:-Pumpkin-MC\/Pumpkin}\/releases\/latest\/download\/${BINARY_NAME}\"\r\nelif [ \"${VERSION}\" = \"nightly\" ]; then\r\n URL=\"https:\/\/github.com\/${GITHUB_PACKAGE:-Pumpkin-MC\/Pumpkin}\/releases\/download\/nightly\/${BINARY_NAME}\"\r\nelse\r\n URL=\"https:\/\/github.com\/${GITHUB_PACKAGE:-Pumpkin-MC\/Pumpkin}\/releases\/download\/${VERSION}\/${BINARY_NAME}\"\r\nfi\r\n\r\necho \"Downloading Pumpkin from: $URL\"\r\ncurl -fsSL \"$URL\" -o \/mnt\/server\/pumpkin\r\nchmod +x \/mnt\/server\/pumpkin\r\n\r\n# Quickly start and kill server to generate initial configuration if not present\r\nif [ ! -f \/mnt\/server\/config\/configuration.toml ]; then\r\n timeout 2 .\/pumpkin || true\r\nfi",
"container": "ghcr.io\/pterodactyl\/installers:alpine",
"entrypoint": "ash"
}
},
@@ -39,52 +40,32 @@
"field_type": "text"
},
{
"name": "Build Release",
"description": "Either build release or a debug build of pumpkin.\r\nScope: installation",
"env_variable": "BUILD_RELEASE",
"default_value": "1",
"name": "Pumpkin Version",
"description": "The version of Pumpkin to install. Options: 'latest', 'nightly', or a specific release tag (e.g. 'v0.1.0').\r\nScope: installation",
"env_variable": "VERSION",
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"rules": "required|string|max:64",
"field_type": "text"
},
{
"name": "Git commit",
"description": "Chose which git commit to clone.\r\nScope: installation",
"env_variable": "GIT_COMMIT",
"name": "GitHub Repository",
"description": "GitHub repository in 'owner\/repo' format to download releases from. Useful if you are using a fork.\r\nScope: installation",
"env_variable": "GITHUB_PACKAGE",
"default_value": "Pumpkin-MC\/Pumpkin",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:128",
"field_type": "text"
},
{
"name": "Direct Download URL",
"description": "Direct URL to download the Pumpkin binary from. If provided, this overrides VERSION and GITHUB_PACKAGE.\r\nScope: installation",
"env_variable": "DOWNLOAD_URL",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|max:40|min:7",
"field_type": "text"
},
{
"name": "Git branch",
"description": "Chose which git branch to clone.\r\nScope: installation",
"env_variable": "GIT_BRANCH",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|max:255",
"field_type": "text"
},
{
"name": "Git URL",
"description": "Chose which git URL to clone from. Useful if you are using a fork.\r\nScope: installation",
"env_variable": "GIT_URL",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Cargo build jobs",
"description": "Amount of jobs that cargo spawns to compile. Try to reduce them if you encounter a deadlock. Value must be at least 1. To use maximum available threads, use the value 'default'\r\nScope: installation",
"env_variable": "CARGO_BUILD_JOBS",
"default_value": "default",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
}