Skip to content

Commit

Permalink
Fix static build
Browse files Browse the repository at this point in the history
  • Loading branch information
the2pizza committed Jan 16, 2025
1 parent 5d6e63e commit de64466
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ jobs:
name: Release
needs: [build-api, build-agent]
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -70,17 +67,23 @@ jobs:
- name: Install protobuf-compiler
run: sudo apt-get install -y protobuf-compiler

- name: Build
run: cargo build --all --release --features agent,api
- name: Install musl-tools
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Add musl target
run: rustup target add x86_64-unknown-linux-musl

- name: Build statically linked binary
run: cargo build --release --target x86_64-unknown-linux-musl

- name: Get architecture
id: arch
run: echo "ARCH=$(uname -m)" >> $GITHUB_ENV

- name: Rename binaries with architecture
run: |
mv target/release/api target/release/api-${{ env.ARCH }}-${{ matrix.os }}
mv target/release/agent target/release/agent-${{ env.ARCH }}-${{ matrix.os }}
mv target/release/api target/release/api-${{ env.ARCH }}
mv target/release/agent target/release/agent-${{ env.ARCH }}
- name: Release
uses: softprops/action-gh-release@v1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pony"
version = "0.0.7-dev"
version = "0.0.8-dev"
edition = "2021"
build = "build.rs"

Expand Down
3 changes: 3 additions & 0 deletions deploy/install
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ PG_DB="${PG_DB:-postgres}"
PG_USERNAME="${PG_USERNAME:-postgres}"
PG_PASSWORD="${PG_PASSWORD:-password}"
API_ENDPOINT=${API_ENDPOINT:-http://localhost:3005}
API_TOKEN=${API_TOKEN:-mysecrettoken}

mkdir -p "$INSTALL_DIR"
cd "$INSTALL_DIR"
Expand Down Expand Up @@ -65,6 +66,7 @@ systemctl daemon-reload
systemctl enable xray

echo "Installing agent version $PONY_VERSION..."
echo "$AGENT_URL"
curl -L -o agent "$AGENT_URL"
chmod +x agent

Expand Down Expand Up @@ -363,6 +365,7 @@ password = "${PG_PASSWORD}"
[api]
endpoint = "$API_ENDPOINT"
token="$API_TOKEN"
EOF
fi

Expand Down
2 changes: 1 addition & 1 deletion src/bin/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use pony::{

#[derive(Parser)]
#[command(
version = "0.0.7-dev",
version = "0.0.8-dev",
about = "Pony Agent - control tool for Xray/Wireguard"
)]
struct Cli {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use pony::{

#[derive(Parser)]
#[command(
version = "0.0.7-dev",
version = "0.0.8-dev",
about = "Pony Api - control tool for Xray/Wireguard"
)]
struct Cli {
Expand Down

0 comments on commit de64466

Please sign in to comment.