mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
chore(ci): add musl builds
This commit is contained in:
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
@@ -41,17 +41,41 @@ jobs:
|
|||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- 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
|
- name: Build Release
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cargo build --verbose --release
|
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
|
- name: Prepare artifacts
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
EXT=""
|
||||||
if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi
|
if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi
|
||||||
cp "target/release/pumpkin$EXT" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}$EXT"
|
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)
|
- name: Upload unsigned executable for SignPath (Windows only)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
|
|||||||
29
.github/workflows/rust.yml
vendored
29
.github/workflows/rust.yml
vendored
@@ -28,7 +28,6 @@ jobs:
|
|||||||
machete:
|
machete:
|
||||||
name: Detect unused dependencies
|
name: Detect unused dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [format]
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain:
|
toolchain:
|
||||||
@@ -42,7 +41,6 @@ jobs:
|
|||||||
clippy_debug:
|
clippy_debug:
|
||||||
name: Run lints (debug)
|
name: Run lints (debug)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [machete]
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain:
|
toolchain:
|
||||||
@@ -59,7 +57,6 @@ jobs:
|
|||||||
clippy_release:
|
clippy_release:
|
||||||
name: Run lints (release)
|
name: Run lints (release)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [machete]
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain:
|
toolchain:
|
||||||
@@ -76,7 +73,7 @@ jobs:
|
|||||||
build_and_test:
|
build_and_test:
|
||||||
name: Build project and test
|
name: Build project and test
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: [clippy_debug, clippy_release]
|
needs: [format, machete, clippy_debug, clippy_release]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
@@ -124,17 +121,41 @@ jobs:
|
|||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- 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
|
- name: Build Release
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cargo build --verbose --release
|
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
|
- name: Prepare artifacts
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
EXT=""
|
||||||
if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi
|
if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi
|
||||||
cp "target/release/pumpkin$EXT" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}$EXT"
|
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
|
- name: Export executable
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -7,10 +7,11 @@
|
|||||||
"exported_at": "2026-02-10T08:07:42+00:00",
|
"exported_at": "2026-02-10T08:07:42+00:00",
|
||||||
"name": "Pumpkin",
|
"name": "Pumpkin",
|
||||||
"author": "lilalexmed@proton.me",
|
"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,
|
"features": null,
|
||||||
"docker_images": {
|
"docker_images": {
|
||||||
"Alpine": "ghcr.io\/pterodactyl\/yolks:alpine"
|
"Alpine": "ghcr.io\/pterodactyl\/yolks:alpine",
|
||||||
|
"Debian": "ghcr.io\/pterodactyl\/yolks:debian"
|
||||||
},
|
},
|
||||||
"file_denylist": [],
|
"file_denylist": [],
|
||||||
"startup": ".\/pumpkin",
|
"startup": ".\/pumpkin",
|
||||||
@@ -22,8 +23,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"installation": {
|
"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",
|
"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": "docker.io\/rust:1-alpine3.21",
|
"container": "ghcr.io\/pterodactyl\/installers:alpine",
|
||||||
"entrypoint": "ash"
|
"entrypoint": "ash"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -39,52 +40,32 @@
|
|||||||
"field_type": "text"
|
"field_type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Build Release",
|
"name": "Pumpkin Version",
|
||||||
"description": "Either build release or a debug build of pumpkin.\r\nScope: installation",
|
"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": "BUILD_RELEASE",
|
"env_variable": "VERSION",
|
||||||
"default_value": "1",
|
"default_value": "latest",
|
||||||
"user_viewable": true,
|
"user_viewable": true,
|
||||||
"user_editable": true,
|
"user_editable": true,
|
||||||
"rules": "required|boolean",
|
"rules": "required|string|max:64",
|
||||||
"field_type": "text"
|
"field_type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Git commit",
|
"name": "GitHub Repository",
|
||||||
"description": "Chose which git commit to clone.\r\nScope: installation",
|
"description": "GitHub repository in 'owner\/repo' format to download releases from. Useful if you are using a fork.\r\nScope: installation",
|
||||||
"env_variable": "GIT_COMMIT",
|
"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": "",
|
"default_value": "",
|
||||||
"user_viewable": true,
|
"user_viewable": true,
|
||||||
"user_editable": 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",
|
"rules": "nullable|string",
|
||||||
"field_type": "text"
|
"field_type": "text"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user