ci: hardcode bucket for visual-diff (#46376)

This commit is contained in:
vagusX 2023-12-11 13:22:24 +08:00 committed by GitHub
parent 2d28495c9c
commit 7eb91d9eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -87,8 +87,6 @@ jobs:
# Execute visual regression diff task and zip then
# output as visualRegressionReport.tar.gz
- name: visual regression diff
env:
ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }}
run: |
npm run visual-regression -- --pr-id=${{ github.event.number }}

View File

@ -88,7 +88,6 @@ jobs:
env:
ALI_OSS_AK_ID: ${{ secrets.ALI_OSS_AK_ID }}
ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }}
ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }}
run: |
mkdir ./visualRegressionReport
tar -xzvf visualRegressionReport.tar.gz -C ./visualRegressionReport

View File

@ -87,7 +87,6 @@ jobs:
env:
ALI_OSS_AK_ID: ${{ secrets.ALI_OSS_AK_ID }}
ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }}
ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }}
run: |
rm package.json
npm i ali-oss --no-save

View File

@ -17,6 +17,8 @@ if (args.length < 2) {
process.exit(1);
}
const ALI_OSS_BUCKET = 'antd-visual-diff';
/**
* Extract the tar file path and ref value from the cli arguments
* @param {string[]} cliArgs
@ -99,7 +101,7 @@ async function boot() {
endpoint: 'oss-cn-shanghai.aliyuncs.com',
accessKeyId: process.env.ALI_OSS_AK_ID,
accessKeySecret: process.env.ALI_OSS_AK_SECRET,
bucket: process.env.ALI_OSS_BUCKET,
bucket: ALI_OSS_BUCKET,
});
// if is a file then upload it directly

View File

@ -19,6 +19,8 @@ import { PNG } from 'pngjs';
import sharp from 'sharp';
import { assert } from 'console';
const ALI_OSS_BUCKET = 'antd-visual-diff';
const compareScreenshots = async (
baseImgPath: string,
currentImgPath: string,
@ -66,7 +68,7 @@ const readPngs = (dir: string) => fs.readdirSync(dir).filter((n) => n.endsWith('
const prettyList = (list: string[]) => list.map((i) => ` * ${i}`).join('\n');
const ossDomain = `https://${process.env.ALI_OSS_BUCKET}.oss-cn-shanghai.aliyuncs.com`;
const ossDomain = `https://${ALI_OSS_BUCKET}.oss-cn-shanghai.aliyuncs.com`;
async function downloadFile(url: string, destPath: string) {
const response = await fetch(url);