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>
This commit is contained in:
45
.github/workflows/gh-pages-fast.yml
vendored
45
.github/workflows/gh-pages-fast.yml
vendored
@ -15,18 +15,45 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get latest release
|
||||
id: latest_release
|
||||
- name: Cache ailog binary
|
||||
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: |
|
||||
LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
|
||||
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
# Get latest release version
|
||||
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
|
||||
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
|
||||
# Check current binary version if exists
|
||||
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
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -13,6 +13,8 @@ on:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
OPENSSL_STATIC: true
|
||||
OPENSSL_VENDOR: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
Reference in New Issue
Block a user