forked from material-extensions/vscode-material-icon-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize svgo config (material-extensions#2301)
* Modernize svgo config * feat: update release yml --------- Co-authored-by: Philipp Kief <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,25 +22,41 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js ⚙️ | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/*' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install node_modules 📦 | ||
run: | | ||
npm ci | ||
npm install --global @vscode/vsce | ||
- name: Generate preview images 🖼️ | ||
run: | | ||
npm run preview | ||
git add images/fileIcons.png | ||
git add images/folderIcons.png | ||
- name: Generate contributors image 📸 | ||
run: | | ||
npm run contributors | ||
git add images/contributors.png | ||
- name: Optimize SVG files ⚡ | ||
run: | | ||
npm run svgo | ||
git add icons/*.svg | ||
- name: Update version ↗ | ||
run: | | ||
git config --global user.name 'Philipp Kief' | ||
git config --global user.email '[email protected]' | ||
git config --global push.followTags true | ||
npm version ${{ env.VERSION_CHANGE }} -m "Release %s" | ||
- name: Get meta data 🔍 | ||
run: | | ||
NODE_VERSION=$(node -p -e "require('./package.json').version") | ||
|
@@ -49,34 +65,34 @@ jobs: | |
echo NAME=$NODE_NAME >> $GITHUB_ENV | ||
NODE_DISPLAY_NAME=$(node -p -e "require('./package.json').displayName") | ||
echo DISPLAY_NAME=$NODE_DISPLAY_NAME >> $GITHUB_ENV | ||
- name: Build ⚒️ | ||
run: vsce package | ||
|
||
- name: Push tags 📌 | ||
run: git push | ||
|
||
- name: Release ${{ env.VERSION }} 🔆 | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ env.NAME }}-${{ env.VERSION }}.vsix | ||
tag_name: v${{ env.VERSION }} | ||
name: ${{ env.DISPLAY_NAME }} v${{ env.VERSION }} | ||
generate_release_notes: true | ||
|
||
- name: Publish to Open VSX Registry 🌐 | ||
uses: HaaLeo/publish-vscode-extension@v1 | ||
with: | ||
pat: ${{ secrets.OPEN_VSX_TOKEN }} | ||
extensionFile: ${{ env.NAME }}-${{ env.VERSION }}.vsix | ||
|
||
- name: Publish to Visual Studio Marketplace 🌐 | ||
uses: HaaLeo/publish-vscode-extension@v1 | ||
with: | ||
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | ||
registryUrl: https://marketplace.visualstudio.com | ||
extensionFile: ${{ env.NAME }}-${{ env.VERSION }}.vsix | ||
|
||
- name: Publish to NPM Registry 🌐 | ||
run: npm publish | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
const { extendDefaultPlugins } = require('svgo'); | ||
|
||
module.exports = { | ||
multipass: true, | ||
precision: 2, | ||
plugins: extendDefaultPlugins([ | ||
plugins: [ | ||
{ | ||
name: 'preset-default' | ||
}, | ||
'convertStyleToAttrs', | ||
'removeDimensions', | ||
'removeOffCanvasPaths', | ||
'removeStyleElement', | ||
'removeScriptElement', | ||
'removeStyleElement', | ||
'reusePaths', | ||
]) | ||
} | ||
'sortAttrs', | ||
] | ||
} |