Skip to content

Commit

Permalink
feat: 🎸 fix xz utils download url error
Browse files Browse the repository at this point in the history
  • Loading branch information
abcfy2 committed Jan 23, 2024
1 parent 656e687 commit e7a5e71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:
if: github.event_name == 'push' || github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set current date as env variable
run: echo "NOW=$(date --utc)" >> $GITHUB_ENV
- uses: dev-drprasad/[email protected]
with:
tag_name: continuous
- name: Delete Continuous Release
run: gh release delete continuous --cleanup-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Prerelease Tag
Expand Down Expand Up @@ -62,7 +63,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: downloads/
Expand Down
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,12 @@ prepare_zlib() {
}

prepare_xz() {
xz_tag="$(retry wget -qO- --compression=auto https://tukaani.org/xz/ \| grep "'was released on'" \| head -1 \| cut -d "' '" -f1)"
xz_latest_url="https://tukaani.org/xz/xz-${xz_tag}.tar.xz"
xz_tag="$(retry wget -qO- --compression=auto https://api.github.com/repos/tukaani-project/xz/releases \| jq -r "'.[0].tag_name'")"
xz_archive_name="$(retry wget -qO- --compression=auto https://api.github.com/repos/tukaani-project/xz/releases \| jq -r "'.[0].assets[].name | select(endswith(\"tar.xz\"))'")"
xz_latest_url="https://github.com/tukaani-project/xz/releases/download/${xz_tag}/${xz_archive_name}"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
xz_latest_url="https://mirror.ghproxy.com/${xz_latest_url}"
fi
if [ ! -f "${DOWNLOADS_DIR}/xz-${xz_tag}.tar.xz" ]; then
retry wget -cT10 -O "${DOWNLOADS_DIR}/xz-${xz_tag}.tar.xz.part" "${xz_latest_url}"
mv -fv "${DOWNLOADS_DIR}/xz-${xz_tag}.tar.xz.part" "${DOWNLOADS_DIR}/xz-${xz_tag}.tar.xz"
Expand Down

0 comments on commit e7a5e71

Please sign in to comment.