diff --git a/.github/conventional-changelog/config.js b/.github/conventional-changelog/config.js new file mode 100644 index 0000000000..f37d94420f --- /dev/null +++ b/.github/conventional-changelog/config.js @@ -0,0 +1,39 @@ +"use strict"; +const config = require("conventional-changelog-conventionalcommits"); + +module.exports = config({ + types: [ + { + type: "feat", + section: "โœจ Features", + }, + { + type: "fix", + section: "๐Ÿ› Bug Fixes", + }, + { + type: "chore", + section: "๐Ÿงน Maintenance", + }, + { + type: "docs", + section: "๐Ÿ“š Documentation", + }, + { + type: "style", + section: "๐Ÿ’… Styles", + }, + { + type: "refactor", + section: "๐Ÿ”จ Refactoring", + }, + { + type: "perf", + section: "โšก Performance Improvements", + }, + { + type: "test", + section: "โœ… Tests", + }, + ], +}); diff --git a/.github/conventional-changelog/pre-changelog-generation.js b/.github/conventional-changelog/pre-changelog-generation.js new file mode 100644 index 0000000000..5b919db1d7 --- /dev/null +++ b/.github/conventional-changelog/pre-changelog-generation.js @@ -0,0 +1,10 @@ +// Next version e.g. 1.12.3 +module.exports = exports = {}; +module.exports.preVersionGeneration = function preVersionGeneration(version) { + return process.env.NYANPASU_VERSION; +}; + +// Next tag e.g. v1.12.3 +module.exports.preTagGeneration = function preTagGeneration(tag) { + return `v${process.env.NYANPASU_VERSION}`; +}; diff --git a/.github/workflows/puiblish.yml b/.github/workflows/puiblish.yml index 8e8bfb7034..ba1d3aa555 100644 --- a/.github/workflows/puiblish.yml +++ b/.github/workflows/puiblish.yml @@ -39,8 +39,6 @@ jobs: shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - name: Install - run: pnpm i - uses: actions/cache@v3 name: Setup pnpm cache with: @@ -48,32 +46,39 @@ jobs: key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- + - name: Install + run: pnpm i + - id: update-version shell: bash name: Bump version # Use npm because yarn is for some reason not able to output only the version name run: | - echo "version=$(pnpm run publish)" >> $GITHUB_OUTPUT + echo "version=$(pnpm run publish ${{ inputs.versionType }} | tail -n1)" >> $GITHUB_OUTPUT git add . - name: Conventional Changelog Action id: build-changelog uses: TriPSs/conventional-changelog-action@v3 with: github-token: ${{ secrets.github_token }} - git-message: "chore(release): {version} ๐Ÿค– [skip ci]" + git-message: "chore(release): {version} ๐Ÿค–" git-user-name: "github-actions[bot]" git-user-email: "41898282+github-actions[bot]@users.noreply.github.com" preset: "conventionalcommits" tag-prefix: "v" - output-file: "UPDATELOG.md" + # output-file: "UPDATELOG.md" # Since v1.4.3, using conventional-changelog-cli@v2.1.0 release-count: "10" + pre-changelog-generation: ".github/conventional-changelog/pre-changelog-generation.js" + config-file-path: ".github/conventional-changelog/config.js" git-branch: "main" + env: + NYANPASU_VERSION: ${{ steps.update-version.outputs.version }} - name: Release uses: softprops/action-gh-release@v1 with: draft: true body: ${{steps.build-changelog.outputs.clean_changelog}} - name: ${{steps.update-version.outputs.version}} + name: Clash Nyanpasu v${{steps.update-version.outputs.version}} tag_name: ${{steps.build-changelog.outputs.tag}} # target_commitish: ${{ steps.tag.outputs.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60dd42f789..77953b984e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,7 @@ jobs: uses: mknejp/delete-release-assets@v1 with: token: ${{ secrets.GH_TOKEN }} - tag: v__VERSION__ + tag: ${{ github.event.release.tag_name }} fail-if-no-assets: false fail-if-no-release: false assets: | @@ -97,11 +97,11 @@ jobs: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} with: - tagName: v__VERSION__ - releaseName: "Clash Nyanpasu v__VERSION__" - releaseBody: "More new features are now supported." - releaseDraft: false - prerelease: false + tagName: ${{ github.event.release.tag_name }} + # releaseName: "Clash Nyanpasu ${{ github.event.release.tag_name }}" + # releaseBody: "More new features are now supported." + # releaseDraft: false + # prerelease: false tauriScript: pnpm tauri args: -f default-meta -c ./backend/tauri/tauri.conf.json diff --git a/package.json b/package.json index 71a833023f..045588abdf 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "autoprefixer": "10.4.17", "colorize-template": "1.0.0", "consola": "3.2.3", + "conventional-changelog-conventionalcommits": "7.0.2", "cross-env": "^7.0.3", "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", @@ -117,7 +118,6 @@ "postcss-scss": "4.0.9", "prettier": "^3.1.0", "prettier-plugin-toml": "2.0.1", - "pretty-quick": "^3.1.3", "sass": "^1.54.0", "shikiji": "0.9.19", "stylelint": "16.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd56cf924e..a6951bf70b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -148,6 +148,9 @@ devDependencies: consola: specifier: 3.2.3 version: 3.2.3 + conventional-changelog-conventionalcommits: + specifier: 7.0.2 + version: 7.0.2 cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -220,9 +223,6 @@ devDependencies: prettier-plugin-toml: specifier: 2.0.1 version: 2.0.1(prettier@3.1.0) - pretty-quick: - specifier: ^3.1.3 - version: 3.1.3(prettier@3.1.0) sass: specifier: ^1.54.0 version: 1.54.8 @@ -2391,10 +2391,6 @@ packages: resolution: {integrity: sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==} dev: true - /@types/minimatch@3.0.5: - resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} - dev: true - /@types/minimist@1.2.5: resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} dev: true @@ -2726,11 +2722,6 @@ packages: is-array-buffer: 3.0.2 dev: true - /array-differ@3.0.0: - resolution: {integrity: sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==} - engines: {node: '>=8'} - dev: true - /array-ify@1.0.0: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} dev: true @@ -2810,11 +2801,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /arrify@2.0.1: - resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==} - engines: {node: '>=8'} - dev: true - /astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} @@ -2991,14 +2977,6 @@ packages: escape-string-regexp: 1.0.5 supports-color: 5.5.0 - /chalk@3.0.0: - resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: true - /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -3454,12 +3432,6 @@ packages: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} dev: true - /end-of-stream@1.4.4: - resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} - dependencies: - once: 1.4.0 - dev: true - /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -3947,21 +3919,6 @@ packages: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} dev: true - /execa@4.1.0: - resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==} - engines: {node: '>=10'} - dependencies: - cross-spawn: 7.0.3 - get-stream: 5.2.0 - human-signals: 1.1.1 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - dev: true - /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -4240,13 +4197,6 @@ packages: hasown: 2.0.0 dev: true - /get-stream@5.2.0: - resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} - engines: {node: '>=8'} - dependencies: - pump: 3.0.0 - dev: true - /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -4497,11 +4447,6 @@ packages: - supports-color dev: true - /human-signals@1.1.1: - resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} - engines: {node: '>=8.12.0'} - dev: true - /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -4529,11 +4474,6 @@ packages: '@babel/runtime': 7.23.5 dev: false - /ignore@5.2.0: - resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} - engines: {node: '>= 4'} - dev: true - /ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} @@ -5255,26 +5195,10 @@ packages: /monaco-editor@0.45.0: resolution: {integrity: sha512-mjv1G1ZzfEE3k9HZN0dQ2olMdwIfaeAAjFiwNprLfYNRSz7ctv9XuCT7gPtBGrMUeV1/iZzYKj17Khu1hxoHOA==} - /mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} - dev: true - /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /multimatch@4.0.0: - resolution: {integrity: sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==} - engines: {node: '>=8'} - dependencies: - '@types/minimatch': 3.0.5 - array-differ: 3.0.0 - array-union: 2.1.0 - arrify: 2.0.1 - minimatch: 3.1.2 - dev: true - /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -5737,22 +5661,6 @@ packages: hasBin: true dev: true - /pretty-quick@3.1.3(prettier@3.1.0): - resolution: {integrity: sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==} - engines: {node: '>=10.13'} - hasBin: true - peerDependencies: - prettier: '>=2.0.0' - dependencies: - chalk: 3.0.0 - execa: 4.1.0 - find-up: 4.1.0 - ignore: 5.2.0 - mri: 1.2.0 - multimatch: 4.0.0 - prettier: 3.1.0 - dev: true - /prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} dependencies: @@ -5764,13 +5672,6 @@ packages: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} dev: false - /pump@3.0.0: - resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} - dependencies: - end-of-stream: 1.4.4 - once: 1.4.0 - dev: true - /punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'}