From 84f83ecf9e1e15d26b7984c7ec9cf73d39ffc946 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Wed, 7 May 2025 16:58:28 +0200 Subject: [PATCH] Support versions 0.1.8-0.4.7 (#135) These versions have different artifact names in the GitHub releases Fixes: #133 --- .github/workflows/test.yml | 7 ++-- dist/ruff-action/index.js | Bin 1481306 -> 1482405 bytes src/download/download-version.ts | 65 +++++++++++++++++++++++++------ 3 files changed, 58 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32d94eb..0826dc8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,10 +40,11 @@ jobs: src: __tests__/fixtures/python-project version: latest test-specific-version: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: - ruff-version: ["0.7.4", "0.7", "0.7.x", ">=0.7.0"] + ruff-version: ["0.1.7", "0.1.8", "0.4.7", "0.4.10", "0.7", "0.7.x", ">=0.7.0"] + os: [ ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-14, windows-latest ] steps: - uses: actions/checkout@v4 - name: Use version ${{ matrix.ruff-version }} @@ -60,7 +61,7 @@ jobs: continue-on-error: true uses: ./ with: - version: v0.0.246 + version: 0.0.246 src: __tests__/fixtures/python-project - name: Check if the action failed run: | diff --git a/dist/ruff-action/index.js b/dist/ruff-action/index.js index 712384d01c6e55eb0017fd7dd8d638304d7a00cc..396f0bbf7f0cdb300107dbf77292056febcf3ba1 100644 GIT binary patch delta 1028 zcmb_b&ubGw6sEO5Z2Uc~SgnW05=$16O@j)OBDEOsS}1zR!DhQN+m0kNVRn+XEK58L zc=6_8E?x!2YcU70_%C?%q_-X#8$Ee+cC-C~^`PLu!0>qA`@Z+RH=nnwuRc_tsv$M3 zPN@+!s>al~I;|#DMx9Y-)j4%uT~HU*rEOH&)yqGJ%H5m0=2gz>sCr8{LGv5RiuP$f-+mB-m=tIk%kBoMpr8 ztjSnRQr3P?DLHp6JE4ea7NAzhhN<6C?J!;j%bM5r9-5iXhJREM>B=5@{vd@e3G!FU z7Qkv-kW^2&1d%Plpr$`n$0qfUJyaPVl!|nrhicw?6uPo#s0;oScGNDJOX9_CIMUqlu05Q1XEWMz*G=Va%*hP+{iUbmjEA^Mq5DOM~&|4|d?i_m5Y!^KNRaQVEP> zvf>9TC8sHPg9apU32Q|#UiD{01nETu)WHJEmLpDsgqOy4>#Rn3sJXm&AOX2CL XL~Arr`)sF=%$+oMs=L#_{PN8&dxU8} delta 187 zcmZ3wH|o}wsD>8C7N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~7QPn#7J(MQEkcGbwr9Q& zTFb(iF#Tc_oA7l1k3uff7k?Cz;Z*>F { let ruffDir: string; if (platform === "pc-windows-msvc") { const fullPathWithExtension = `${downloadPath}${extension}`; @@ -55,16 +99,15 @@ export async function downloadVersion( ruffDir = await tc.extractZip(fullPathWithExtension); // On windows extracting the zip does not create an intermediate directory } else { - const extractedDir = await tc.extractTar(downloadPath); - ruffDir = path.join(extractedDir, artifact); + ruffDir = await tc.extractTar(downloadPath); + if (semver.gte(version, "v0.5.0")) { + // Since v0.5.0 an intermediate directory is created + ruffDir = path.join(ruffDir, artifact); + } } - const cachedToolDir = await tc.cacheDir( - ruffDir, - TOOL_CACHE_NAME, - version, - arch, - ); - return { version: version, cachedToolDir }; + const files = await fs.readdir(ruffDir); + core.debug(`Contents of ${ruffDir}: ${files.join(", ")}`); + return ruffDir; } export async function resolveVersion(