1
0

update zola version

This commit is contained in:
sangge-redmi 2025-02-07 13:27:37 +08:00
parent a615780b69
commit ad28b73245
3 changed files with 15 additions and 3 deletions

View File

@ -7,4 +7,5 @@ This action sets up Zola static site generator in your GitHub Actions workflow.
```yaml
uses: my-org/setup-zola@v1
with:
version: '0.18.0' # Optional
version: "0.19.2" # Optional
```

View File

@ -9,6 +9,7 @@ runs:
using: "composite"
steps:
- name: Run install script
shell: bash
run: |
chmod +x ${{ github.action_path }}/scripts/install_zola.sh
${{ github.action_path }}/scripts/install_zola.sh ${{ inputs.version }}

View File

@ -2,10 +2,20 @@
set -e
ZOLA_VERSION="0.18.0"
ZOLA_VERSION="0.19.2"
BASE_URL="https://git.mamahaha.work/api/packages/actions/generic/zola"
echo "Checking Zola version $ZOLA_VERSION..."
# 使用 -I 只获取头信息,-s 静默模式
if ! curl -Is "${BASE_URL}/${ZOLA_VERSION}/zola" | grep -q "200 OK"; then
echo "Error: Version $ZOLA_VERSION not found"
exit 1
fi
echo "Downloading Zola version $ZOLA_VERSION..."
wget https://minio.mamahaha.work/mybucket/zola-$ZOLA_VERSION -q -O zola
curl -OJ "${BASE_URL}/${ZOLA_VERSION}/zola"
chmod +x zola
sudo mv zola /usr/local/bin