Skip to content

Commit

Permalink
ci(release): get the file name dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Jan 22, 2023
1 parent 72b1d9f commit c4de922
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 38 deletions.
45 changes: 16 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ jobs:
run: |
pnpm run build
zip -r dist.zip dist/
- name: Get CSS file name
id: get_css_file_name
run: |
echo "::set-output name=css_file_name::$(ls dist/assets/ | grep css)"
- name: Get JS file name (index-xxx.js)
id: get_js_file_name
run: |
echo "::set-output name=js_file_name::$(ls dist/assets | grep js)"
- name: Get release
id: get_release
Expand Down Expand Up @@ -81,8 +89,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dist/assets/index-c8f8134b.css
asset_name: index-c8f8134b.css
asset_path: ./dist/assets/${{ steps.get_css_file_name.outputs.css_file_name }}
asset_name: ${{ steps.get_css_file_name.outputs.css_file_name }}
asset_content_type: text/css

- name: Upload Release Asset - index.js
Expand All @@ -91,36 +99,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dist/index-139f436d.js
asset_name: index-139f436d.js
asset_content_type: application/javascript

- name: Upload Release Asset - icon-park.js
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dist/icon-park-359d24ea.js
asset_name: icon-park-359d24ea.js
asset_path: ./dist/assets/${{ steps.get_js_file_name.outputs.js_file_name }}
asset_name: ${{ steps.get_js_file_name.outputs.js_file_name }}
asset_content_type: application/javascript

# - name: Upload Release Asset - background.avif
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: ./dist/background.avif
# asset_name: background.avif
# asset_content_type: image/avif

- name: Upload Release Asset - vditor.js
- name: Upload Release Asset - background.avif
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dist/vditor-4d236c9d.js
asset_name: vditor-4d236c9d.js
asset_content_type: application/javascript
asset_path: ./dist/background.avif
asset_name: background.avif
asset_content_type: image/avif
9 changes: 0 additions & 9 deletions scripts/replace-hash.sh

This file was deleted.

0 comments on commit c4de922

Please sign in to comment.