diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml deleted file mode 100644 index 6b525cd38..000000000 --- a/.github/workflows/extension.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: extension - -permissions: {} - -on: - push: - tags: - - '*_*_*' - -jobs: - extension: - runs-on: ubuntu-24.04 - env: - BLENDER_ARCHIVE_URL: https://mirrors.ocf.berkeley.edu/blender/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Cache archive - id: cache-archive - uses: actions/cache@v4 - with: - path: blender.tar.xz - key: ${{ env.BLENDER_ARCHIVE_URL }}-archive-1 - - name: Download archive - if: steps.cache-archive.outputs.cache-hit != 'true' - run: curl --fail --location --show-error --retry 5 --retry-all-errors "$BLENDER_ARCHIVE_URL" -o blender.tar.xz || true - - name: Build Extension - run: | - mkdir -p ~/.local/blender - if ! tar xf blender.tar.xz -C ~/.local/blender --strip-components=1; then - echo "Please upgrade archive URL" - exit 0 - fi - export PATH="$HOME/.local/blender:$PATH" - hash -r - ./tools/build_extension.sh - - name: Save Extension - uses: actions/upload-artifact@v4 - with: - name: Extension - path: extension_output diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index a241bbd92..cb9c3f24a 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -27,7 +27,6 @@ jobs: git checkout README cp -fr ../.github . rm .github/workflows/gh-pages.yml - rm .github/workflows/extension.yml rm .github/workflows/readme.yml rm .github/workflows/release.yml rm .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 040914c89..191e4737c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,25 @@ on: jobs: release: runs-on: ubuntu-24.04 + env: + BLENDER_ARCHIVE_URL: https://mirrors.ocf.berkeley.edu/blender/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz steps: - name: Install package run: | sudo apt-get update -qq sudo apt-get dist-upgrade -y sudo apt-get install -y advancecomp blender curl git python3 python3-numpy ruby shellcheck xz-utils + - name: Cache archive + id: cache-archive + uses: actions/cache@v4 + with: + path: blender.tar.xz + key: ${{ env.BLENDER_ARCHIVE_URL }}-archive-1 + - name: Download archive + if: steps.cache-archive.outputs.cache-hit != 'true' + run: | + curl --fail --location --show-error --retry 5 --retry-all-errors "$BLENDER_ARCHIVE_URL" -o blender.tar.xz + test "$(md5sum blender.tar.xz)" = "d4555313745524a6add308001e3198cfa blender.tar.xz" - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/tools/release.sh b/tools/release.sh index 91d26f22d..05279680e 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -40,6 +40,23 @@ for postfix in "$release_postfix" "$tag_name"; do cp "${work_dir}/${prefix_name}-${postfix}.zip" . done +mkdir -p ~/.local/blender +if ! tar xf blender.tar.xz -C ~/.local/blender --strip-components=1; then + echo "Please upgrade archive URL" + exit 1 +fi +export PATH="$HOME/.local/blender:$PATH" +hash -r +test "$HOME/.local/blender/blender" = "$(command -v blender)" +./tools/build_extension.sh +extension_path=$(find extension_output -name "vrm_*_*.zip" | sort | head -n 1) +if [ ! -f "$extension_path" ]; then + echo "No extension output" + exit 1 +fi +rm -fr ~/.local/blender +hash -r + if ! curl \ --fail \ --show-error \ @@ -67,7 +84,23 @@ if ! curl \ --header "Authorization: Bearer $GITHUB_TOKEN" \ --header "Content-Type: application/zip" \ --data-binary "@${prefix_name}-${tag_name}.zip" \ - "${upload_url}?name=${prefix_name}-${tag_name}.zip&label=VRM%20Add-on%20for%20Blender%20${version}%20(zip)"; then + "${upload_url}?name=${prefix_name}-${tag_name}.zip&label=(Blender%202.93%20-%204.1)%20VRM%20Add-on%20for%20Blender%20${version}%20(zip)"; then + + cat release_upload.json + exit 1 +fi + +if ! curl \ + --fail \ + --show-error \ + --location \ + --output release_upload.json \ + --request POST \ + --header 'Accept: application/vnd.github.v3+json' \ + --header "Authorization: Bearer $GITHUB_TOKEN" \ + --header "Content-Type: application/zip" \ + --data-binary "@${extension_path}" \ + "${upload_url}?name=${prefix_name}-Extension-${tag_name}.zip&label=(Blender%204.2%20or%20later)%20VRM%20Add-on%20for%20Blender%20Extension%20${version}%20(zip)"; then cat release_upload.json exit 1