diff --git a/README.md b/README.md index 4b20478..bdeb908 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/action.yml b/action.yml index ec13b4e..a0a8587 100644 --- a/action.yml +++ b/action.yml @@ -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 }} diff --git a/scripts/install_zola.sh b/scripts/install_zola.sh index 27e32ff..11937f9 100644 --- a/scripts/install_zola.sh +++ b/scripts/install_zola.sh @@ -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