Skip to content

Commit 792e30a

Browse files
committed
ci: replease relative img urls in README
1 parent aa4c386 commit 792e30a

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Replace image urls in README'
2+
description: 'Replace image relative paths to cdn.jsdelivr.net in README and README.zh-CN'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- run: |
7+
sed -i "s|./public/enum-plus.svg|https://cdn.jsdelivr.net/gh/shijistar/enum-plus/public/enum-plus.svg|g" README.md
8+
sed -i "s|./public/enum-plus.svg|https://cdn.jsdelivr.net/gh/shijistar/enum-plus/public/enum-plus.svg|g" README.zh-CN.md
9+
sed -i "s|./public/usage-screenshot.gif|https://cdn.jsdelivr.net/gh/shijistar/enum-plus/public/usage-screenshot.gif|g" README.md
10+
sed -i "s|./public/usage-screenshot.gif|https://cdn.jsdelivr.net/gh/shijistar/enum-plus/public/usage-screenshot.gif|g" README.zh-CN.md
11+
sed -i "s|./public/jsdoc-en.png|https://cdn.jsdelivr.net/gh/shijistar/enum-plus/public/jsdoc-en.png|g" README.md
12+
sed -i "s|./public/jsdoc-chs.png|https://cdn.jsdelivr.net/gh/shijistar/enum-plus/public/jsdoc-chs.png|g" README.zh-CN.md
13+
shell: bash

.github/workflows/npm-publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
enum-plus.umd.tar.gz
4343
token: ${{ secrets.GITHUB_TOKEN }}
4444

45+
- name: Replace relative image url to cdn.jsdelivr.net
46+
uses: ./.github/actions/replace-img-url
47+
4548
- name: Replace download url to the releasing version
4649
uses: ./.github/actions/replace-url
4750
with:

package-legacy-node13.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"npm-run-all": "^4.1.5",
1010
"shx": "^0.3.4",
1111
"ts-jest": "^23.10.5",
12+
"tsx": "^3.14.0",
1213
"typescript": "^4.0.8"
1314
}
1415
}

package-legacy-node15.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"npm-run-all": "^4.1.5",
1010
"shx": "^0.3.4",
1111
"ts-jest": "^24.3.0",
12+
"tsx": "^3.14.0",
1213
"typescript": "^4.0.8"
1314
}
1415
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
"test:browser:ui": "npm run test:browser:bundle && playwright test --ui",
8484
"test:browser:debug": "npm run test:browser:bundle && playwright test --debug",
8585
"prepare": "husky",
86-
"prepare-legacy-node13": "tsx ./scripts/prepare-legacy.ts node13",
87-
"prepare-legacy-node15": "tsx ./scripts/prepare-legacy.ts node15"
86+
"prepare-legacy-node13": "node ./scripts/prepare-legacy.js node13",
87+
"prepare-legacy-node15": "node ./scripts/prepare-legacy.js node15"
8888
},
8989
"devDependencies": {
9090
"@playwright/test": "^1.52.0",
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { writeFileSync } from 'fs';
2-
import pkg from '../package.json';
3-
import tsconfig from '../tsconfig.json';
4-
import libTsconfig from '../tsconfig.lib.json';
1+
/*----------------------------------------------------------------------------*/
2+
/* WARNING: THIS FILE MUST BE MAINTAINED AS JAVASCRIPT (NOT TYPESCRIPT), */
3+
/* AND REMAIN COMPATIBLE WITH NODE.JS V13 */
4+
/*----------------------------------------------------------------------------*/
5+
const { writeFileSync } = require('fs');
6+
const pkg = require('../package.json');
7+
const tsconfig = require('../tsconfig.json');
8+
const libTsconfig = require('../tsconfig.lib.json');
59

610
const versionFile = process.argv[2];
711
// eslint-disable-next-line @typescript-eslint/no-var-requires

0 commit comments

Comments
 (0)