Skip to content

Commit

Permalink
fix: publish ci
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Jan 20, 2024
1 parent 21e17b4 commit a518542
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 115 deletions.
39 changes: 39 additions & 0 deletions .github/conventional-changelog/config.js
Original file line number Diff line number Diff line change
@@ -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",
},
],
});
10 changes: 10 additions & 0 deletions .github/conventional-changelog/pre-changelog-generation.js
Original file line number Diff line number Diff line change
@@ -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}`;
};
17 changes: 11 additions & 6 deletions .github/workflows/puiblish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,46 @@ 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:
path: ${{ env.STORE_PATH }}
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 }}
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
105 changes: 3 additions & 102 deletions pnpm-lock.yaml

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

0 comments on commit a518542

Please sign in to comment.