1 Commits

Author SHA1 Message Date
4ad1d3edf6 Fix cross-compilation issues and private repo access
- Replace native-tls with rustls-tls for cross-platform compatibility
- Add vendored OpenSSL/libgit2 features for static linking
- Add connect feature to tokio-tungstenite
- Add GITHUB_TOKEN authentication for private repo access
- Add smart binary caching with version checking workflow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 16:26:36 +09:00
4 changed files with 46 additions and 14 deletions

View File

@ -42,7 +42,10 @@
"WebFetch(domain:syui.ai)", "WebFetch(domain:syui.ai)",
"Bash(rustup target list:*)", "Bash(rustup target list:*)",
"Bash(rustup target:*)", "Bash(rustup target:*)",
"Bash(git add:*)" "Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git push:*)",
"Bash(git tag:*)"
], ],
"deny": [] "deny": []
} }

View File

@ -15,18 +15,45 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Get latest release - name: Cache ailog binary
id: latest_release uses: actions/cache@v4
with:
path: ./bin
key: ailog-bin-${{ runner.os }}
restore-keys: |
ailog-bin-${{ runner.os }}
- name: Check and update ailog binary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name) # Get latest release version
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT LATEST_VERSION=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
echo "Latest version: $LATEST_VERSION"
- name: Download pre-built binary from release # Check current binary version if exists
run: |
curl -sL https://github.com/${{ github.repository }}/releases/download/${{ steps.latest_release.outputs.tag }}/ailog-linux-x86_64.tar.gz | tar -xzf -
chmod +x ailog
mkdir -p ./bin mkdir -p ./bin
mv ailog ./bin/ if [ -f "./bin/ailog" ]; then
CURRENT_VERSION=$(./bin/ailog --version | awk '{print $2}' || echo "unknown")
echo "Current version: $CURRENT_VERSION"
else
CURRENT_VERSION="none"
echo "No binary found"
fi
# Download if version is different or binary doesn't exist
if [ "$CURRENT_VERSION" != "${LATEST_VERSION#v}" ]; then
echo "Downloading ailog $LATEST_VERSION..."
curl -sL -H "Authorization: Bearer $GITHUB_TOKEN" \
https://github.com/${{ github.repository }}/releases/download/$LATEST_VERSION/ailog-linux-x86_64.tar.gz | tar -xzf -
mv ailog ./bin/ailog
chmod +x ./bin/ailog
echo "Updated to version: $(./bin/ailog --version)"
else
echo "Binary is up to date"
chmod +x ./bin/ailog
fi
- name: Setup Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v3 uses: peaceiris/actions-hugo@v3

View File

@ -13,6 +13,8 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
OPENSSL_STATIC: true
OPENSSL_VENDOR: true
jobs: jobs:
build: build:

View File

@ -26,7 +26,7 @@ fs_extra = "1.3"
colored = "2.1" colored = "2.1"
serde_yaml = "0.9" serde_yaml = "0.9"
syntect = "5.2" syntect = "5.2"
reqwest = { version = "0.12", features = ["json"] } reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
rand = "0.8" rand = "0.8"
sha2 = "0.10" sha2 = "0.10"
base64 = "0.22" base64 = "0.22"
@ -43,12 +43,12 @@ cookie = "0.18"
syn = { version = "2.0", features = ["full", "parsing", "visit"] } syn = { version = "2.0", features = ["full", "parsing", "visit"] }
quote = "1.0" quote = "1.0"
ignore = "0.4" ignore = "0.4"
git2 = "0.18" git2 = { version = "0.18", features = ["vendored-openssl", "vendored-libgit2", "ssh"], default-features = false }
regex = "1.0" regex = "1.0"
# ATProto and stream monitoring dependencies # ATProto and stream monitoring dependencies
tokio-tungstenite = { version = "0.21", features = ["native-tls"] } tokio-tungstenite = { version = "0.21", features = ["rustls-tls-webpki-roots", "connect"], default-features = false }
futures-util = "0.3" futures-util = "0.3"
tungstenite = { version = "0.21", features = ["native-tls"] } tungstenite = { version = "0.21", features = ["rustls-tls-webpki-roots"], default-features = false }
[dev-dependencies] [dev-dependencies]
tempfile = "3.14" tempfile = "3.14"