From a821eb91ed6d497bb8f51b295ec6ad778ab837a2 Mon Sep 17 00:00:00 2001 From: mlischetti Date: Tue, 28 Jul 2026 16:20:30 -0300 Subject: [PATCH] ci: stop double-zipping single-file upload artifacts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions/upload-artifact always wraps its payload in a .zip, so uploading an already-compressed file (the CLI distro .zip, the Python .whl, the Node .tgz) produced a .zip-containing-that-file — a redundant outer archive. v7.0.0 added an `archive: false` input that uploads a single file as-is. Bump all four upload steps to @v7.0.1 and set archive:false on the three single-file artifacts. Under archive:false the `name:` input is ignored and the file's own name becomes the artifact name, so: - CLI distro and Python wheel are already OS-unique (script_name / platform tag in the filename) — `name:` dropped, no collision. - npm pack emits an identical dataweave-native-0.0.1.tgz on every OS, which would collide across the matrix; a staging step copies it to an OS-qualified name first. The dwlib step uploads multiple files (archive:false allows only one), so it stays archived — bumped to v7.0.1 for version consistency, behavior unchanged. Release assets (release.yml, svenstaro/upload-release-action) are a separate path and unaffected. No download-artifact consumers depend on the old artifact names; the only visible change is the artifact labels in the Actions UI now match the uploaded file names. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++--------- .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++---------- 2 files changed, 61 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6510f5..bb4e9a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,28 +73,49 @@ jobs: # Upload the artifact file - name: Upload generated script - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: - name: dw-${{env.NATIVE_VERSION}}-${{runner.os}} + # archive:false skips the redundant outer zip (the distro is already a + # .zip) and names the artifact after the file — which already carries + # ${matrix.script_name}, so the matrix legs don't collide. No `name:`: + # it would be ignored under archive:false. path: native-cli/build/distributions/native-cli-${{env.NATIVE_VERSION}}-native-distro-${{ matrix.script_name }}.zip + archive: false # Upload the Python wheel - name: Upload Python wheel - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: - name: dw-python-wheel-${{env.NATIVE_VERSION}}-${{runner.os}} + # archive:false skips the redundant outer zip and names the artifact + # after the wheel — whose platform tag (manylinux/win_amd64/…) is + # already OS-unique, so the matrix legs don't collide. No `name:`: it + # would be ignored under archive:false. path: native-lib/python/dist/dataweave_native-0.0.1-py3-*.whl + archive: false + + # npm pack emits the same filename (dataweave-native-0.0.1.tgz) on every + # OS. With archive:false the file NAME becomes the artifact name (the + # `name:` input is ignored), so copy to an OS-qualified name first to keep + # the matrix legs from colliding. + - name: Stage OS-qualified Node package + run: cp native-lib/node/dataweave-native-0.0.1.tgz "native-lib/node/dataweave-native-0.0.1-${{ runner.os }}.tgz" + shell: bash # Upload the Node.js package - name: Upload Node package - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: - name: dw-node-package-${{env.NATIVE_VERSION}}-${{runner.os}} - path: native-lib/node/dataweave-native-0.0.1.tgz + path: native-lib/node/dataweave-native-0.0.1-${{ runner.os }}.tgz + # Single .tgz (already gzip-compressed); skip the redundant outer zip + # (v7+ feature). archive:false ignores `name:` and uses the file name, + # which the copy above made OS-unique. + archive: false - # Upload the native shared library + header together per OS + # Upload the native shared library + header together per OS. Multiple + # files, so this stays archived (archive:false allows only one file); the + # zip is wanted here and `name:` still applies. - name: Upload native shared library - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: name: dwlib-${{env.NATIVE_VERSION}}-${{runner.os}} path: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3628fe4..a0aa711 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -110,28 +110,49 @@ jobs: # Upload the artifact file - name: Upload generated script - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: - name: dw-${{env.NATIVE_VERSION}}-${{runner.os}} + # archive:false skips the redundant outer zip (the distro is already a + # .zip) and names the artifact after the file — which already carries + # ${matrix.script_name}, so the matrix legs don't collide. No `name:`: + # it would be ignored under archive:false. path: native-cli/build/distributions/native-cli-${{env.NATIVE_VERSION}}-native-distro-${{ matrix.script_name }}.zip + archive: false # Upload the Python wheel - name: Upload Python wheel - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: - name: dw-python-wheel-${{env.NATIVE_VERSION}}-${{runner.os}} + # archive:false skips the redundant outer zip and names the artifact + # after the wheel — whose platform tag (manylinux/win_amd64/…) is + # already OS-unique, so the matrix legs don't collide. No `name:`: it + # would be ignored under archive:false. path: native-lib/python/dist/dataweave_native-0.0.1-py3-*.whl + archive: false + + # npm pack emits the same filename (dataweave-native-0.0.1.tgz) on every + # OS. With archive:false the file NAME becomes the artifact name (the + # `name:` input is ignored), so copy to an OS-qualified name first to keep + # the matrix legs from colliding. + - name: Stage OS-qualified Node package + run: cp native-lib/node/dataweave-native-0.0.1.tgz "native-lib/node/dataweave-native-0.0.1-${{ runner.os }}.tgz" + shell: bash # Upload the Node.js package - name: Upload Node package - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: - name: dw-node-package-${{env.NATIVE_VERSION}}-${{runner.os}} - path: native-lib/node/dataweave-native-0.0.1.tgz - - # Upload the native shared library + header together per OS + path: native-lib/node/dataweave-native-0.0.1-${{ runner.os }}.tgz + # Single .tgz (already gzip-compressed); skip the redundant outer zip + # (v7+ feature). archive:false ignores `name:` and uses the file name, + # which the copy above made OS-unique. + archive: false + + # Upload the native shared library + header together per OS. Multiple + # files, so this stays archived (archive:false allows only one file); the + # zip is wanted here and `name:` still applies. - name: Upload native shared library - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: name: dwlib-${{env.NATIVE_VERSION}}-${{runner.os}} path: |