Skip to content

Commit

Permalink
Improve release workflow (#1378)
Browse files Browse the repository at this point in the history
* Filter out release commits

* Fix compare link

* Adjust preview script for folder icons

* Update release workflow

* Update release commit message

Should be the same commit messages as used before

* Use changelog machine to generate changelog for release

* Update dependency

* Update build script
  • Loading branch information
PKief committed Feb 10, 2022
1 parent 3ad3ff7 commit 97d8114
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
shell: bash
if: ${{ success() && matrix.os == 'ubuntu-latest' }}
- name: Install node_modules 📦
run: npm install
run: npm ci
- name: Cache node_modules 💾
uses: actions/cache@v2
env:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,41 @@ jobs:
node-version: 'lts/*'
- name: Install node_modules 📦
run: |
npm install
npm ci
npm install --global vsce
- name: Update version ↗
run: |
git config --global user.name 'Philipp Kief'
git config --global user.email 'PKief@users.noreply.github.com'
git config --global push.followTags true
npm version ${{ env.VERSION_CHANGE }}
- name: Get version 🔍
npm version ${{ env.VERSION_CHANGE }} -m "Release %s"
- name: Get meta data 🔍
run: |
NODE_VERSION=$(node -p -e "require('./package.json').version")
echo VERSION=$NODE_VERSION >> $GITHUB_ENV
NODE_NAME=$(node -p -e "require('./package.json').name")
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: material-icon-theme-${{ env.VERSION }}.vsix
files: ${{ env.NAME }}-${{ env.VERSION }}.vsix
tag_name: v${{ env.VERSION }}
name: Material Icon Theme 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: material-icon-theme-${{ env.VERSION }}.vsix
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: material-icon-theme-${{ env.VERSION }}.vsix
extensionFile: ${{ env.NAME }}-${{ env.VERSION }}.vsix
4 changes: 4 additions & 0 deletions changelog.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"repositoryUrl": "https://github.com/PKief/vscode-material-icon-theme",
"blacklistPattern": "^Release \\d+\\.\\d+\\.\\d+|^\\d+\\.\\d+\\.\\d+$"
}
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"preview": "ts-node ./src/scripts/preview",
"svgo": "svgo -i icons -o icons -q",
"test": "node ./out/test/runTest.js",
"changelog": "ts-node ./src/scripts/changelog/index",
"changelog": "changelog-machine --config changelog.config.json",
"preversion": "npm run contributors && git add images/contributors.png && npm run preview && git add images/fileIcons.png && git add images/folderIcons.png",
"version": "npm run changelog && git add CHANGELOG.md",
"vscode:prepublish": "npm run lint && npm run compile && npm run package-web"
Expand Down Expand Up @@ -238,6 +238,7 @@
"@types/vscode": "~1.51.0",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"changelog-machine": "^1.0.0",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
5 changes: 0 additions & 5 deletions src/scripts/changelog/config.ts

This file was deleted.

123 changes: 0 additions & 123 deletions src/scripts/changelog/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/scripts/changelog/models.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/scripts/preview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ const folderThemes = filterDuplicates(
folderIcons
.map((theme) => {
const folders = [];
if (theme.defaultIcon.name !== '') {
folders.push(theme.defaultIcon.name);
}
if (theme.icons && theme.icons.length > 0) {
folders.push(...theme.icons.map((i) => i.name));
}
Expand Down

0 comments on commit 97d8114

Please sign in to comment.