Skip to content

Commit 90f7e73

Browse files
committed
feat: improve the replacement logic in README3
1 parent e7b76f9 commit 90f7e73

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

.github/workflows/npm-publish.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@ jobs:
128128
tar -cvf ../../enum-plus-legacy.umd.tar.gz *
129129
cd ../..
130130
131-
- name: Replace relative image url to cdn.jsdelivr.net
132-
uses: ./.github/actions/replace-img-url
133-
134-
- name: Replace download url to the releasing version
135-
uses: ./.github/actions/replace-path-url
136-
with:
137-
version: ${{ github.event.release.tag_name }}
138-
139131
- name: Add Assets to Release
140132
uses: softprops/action-gh-release@v1
141133
with:
@@ -144,12 +136,30 @@ jobs:
144136
umd-zip/enum-plus-legacy.umd.min.js.gz
145137
enum-plus.umd.tar.gz
146138
enum-plus-legacy.umd.tar.gz
147-
README.md
148-
README.zh-CN.md
149139
token: ${{ secrets.GITHUB_TOKEN }}
150140

141+
- name: Replace relative image url to cdn.jsdelivr.net
142+
uses: ./.github/actions/replace-img-url
143+
144+
- name: Replace download url to the releasing version
145+
uses: ./.github/actions/replace-path-url
146+
with:
147+
version: ${{ github.event.release.tag_name }}
148+
151149
- name: Add 'user-content-' prefix to anchor links
152150
uses: ./.github/actions/replace-anchor
151+
- name: Gzip umd files
152+
run: |
153+
cp README.md README-zip.md
154+
cp README.zh-CN.md README.zh-CN-zip.md
155+
156+
- name: Add README to Release
157+
uses: softprops/action-gh-release@v1
158+
with:
159+
files: |
160+
README-zip.md
161+
README.zh-CN-zip.md
162+
token: ${{ secrets.GITHUB_TOKEN }}
153163

154164
# - name: Request the latest version of enum-plus
155165
# id: get_latest_version_before_publish

0 commit comments

Comments
 (0)