From 9681e3ac46d14312ca61a7f6152a02108d55a805 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 13 Oct 2024 18:36:23 +0900 Subject: [PATCH] Overwrite downloaded data packages In https://github.com/ppy/osu/actions/runs/11311858931/job/31458581002, I cancelled the run during the download from `data.ppy.sh`. In https://github.com/ppy/osu/actions/runs/11313128285/job/31461534857, `wget` skipped downloading the file due to the `-nc` option (no-clobber), i.e.: if the file exists, don't re-download. The only way I'm aware of to resolve this with wget is to either use `-c` (continue), which may lead to broken files, or to explicitly specify the output file via `-O`. Thought I'd clean up a few pieces in the process. Why not curl? Mostly historical - some distros don't come with curl. It may be okay now but there's probably no point changing this at the moment... --- .github/workflows/diffcalc.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/diffcalc.yml b/.github/workflows/diffcalc.yml index ebf22b8a0e..3b77a463c1 100644 --- a/.github/workflows/diffcalc.yml +++ b/.github/workflows/diffcalc.yml @@ -273,22 +273,23 @@ jobs: echo "TARGET_DIR=${{ needs.directory.outputs.GENERATOR_DIR }}/sql/${ruleset}" >> "${GITHUB_OUTPUT}" echo "DATA_NAME=${performance_data_name}" >> "${GITHUB_OUTPUT}" + echo "DATA_PKG=${performance_data_name}.tar.bz2" >> "${GITHUB_OUTPUT}" - name: Restore cache id: restore-cache uses: maxnowack/local-cache@720e69c948191660a90aa1cf6a42fc4d2dacdf30 # v2 with: - path: ${{ steps.query.outputs.DATA_NAME }}.tar.bz2 + path: ${{ steps.query.outputs.DATA_PKG }} key: ${{ steps.query.outputs.DATA_NAME }} - name: Download if: steps.restore-cache.outputs.cache-hit != 'true' run: | - wget -q -nc "https://data.ppy.sh/${{ steps.query.outputs.DATA_NAME }}.tar.bz2" + wget -q -O "${{ steps.query.outputs.DATA_PKG }}" "https://data.ppy.sh/${{ steps.query.outputs.DATA_PKG }}" - name: Extract run: | - tar -I lbzip2 -xf "${{ steps.query.outputs.DATA_NAME }}.tar.bz2" + tar -I lbzip2 -xf "${{ steps.query.outputs.DATA_PKG }}" rm -r "${{ steps.query.outputs.TARGET_DIR }}" mv "${{ steps.query.outputs.DATA_NAME }}" "${{ steps.query.outputs.TARGET_DIR }}" @@ -304,22 +305,23 @@ jobs: echo "TARGET_DIR=${{ needs.directory.outputs.GENERATOR_DIR }}/beatmaps" >> "${GITHUB_OUTPUT}" echo "DATA_NAME=${beatmaps_data_name}" >> "${GITHUB_OUTPUT}" + echo "DATA_PKG=${beatmaps_data_name}.tar.bz2" >> "${GITHUB_OUTPUT}" - name: Restore cache id: restore-cache uses: maxnowack/local-cache@720e69c948191660a90aa1cf6a42fc4d2dacdf30 # v2 with: - path: ${{ steps.query.outputs.DATA_NAME }}.tar.bz2 + path: ${{ steps.query.outputs.DATA_PKG }} key: ${{ steps.query.outputs.DATA_NAME }} - name: Download if: steps.restore-cache.outputs.cache-hit != 'true' run: | - wget -q -nc "https://data.ppy.sh/${{ steps.query.outputs.DATA_NAME }}.tar.bz2" + wget -q -O "${{ steps.query.outputs.DATA_PKG }}" "https://data.ppy.sh/${{ steps.query.outputs.DATA_PKG }}" - name: Extract run: | - tar -I lbzip2 -xf "${{ steps.query.outputs.DATA_NAME }}.tar.bz2" + tar -I lbzip2 -xf "${{ steps.query.outputs.DATA_PKG }}" rm -r "${{ steps.query.outputs.TARGET_DIR }}" mv "${{ steps.query.outputs.DATA_NAME }}" "${{ steps.query.outputs.TARGET_DIR }}"