Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Apr 5, 2022
1 parent 8e76607 commit a18f87d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- id: setPackageJSON
- id: setPluginInfoJSON
run: |
content=`cat ./package.json`
content=`cat ./src/plugin.info`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# here we replace "title": "$:/plugins/linonetwo/tw-example-plugin", to "title": "linonetwo/tw-example-plugin",
# so it can be used in tiddly-gittly/tw5-plugin-packer to find output path
content="${content//$\:\/plugins\//}"
# end of optional handling for multi line json
echo "::set-output name=packageJson::$content"
echo "::set-output name=pluginInfoJSON::$content"
- name: Get npm cache directory
uses: actions/cache@v3
Expand All @@ -61,8 +64,8 @@ jobs:
- uses: tiddly-gittly/tw5-plugin-packer@v0.0.10
with:
minify: 'true'
# here we read plugin author and name from packageJSON, and packageJSON is read in the step above with id `setPackageJSON`
source: 'dist/plugins/${{fromJson(steps.setPackageJSON.outputs.packageJson).author}}/${{fromJson(steps.setPackageJSON.outputs.packageJson).name}}'
# here we read plugin author and name from pluginInfoJSON, and pluginInfoJSON is read in the step above with id `setPluginInfoJSON`
source: 'dist/plugins/${{fromJson(steps.setPluginInfoJSON.outputs.pluginInfoJSON).title}}'
output: 'dist/out'
uglifyjs-options: '{ "warnings": false, "ie8": false, "safari10": false }'
cleancss-options: '{ "compatibility": "*", "level": 2 }'
Expand Down

0 comments on commit a18f87d

Please sign in to comment.