generated from obsidianmd/obsidian-sample-plugin
-
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.
- Loading branch information
1 parent
647c770
commit 4d34327
Showing
5 changed files
with
97 additions
and
76 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 |
---|---|---|
@@ -1,53 +1,18 @@ | ||
name: "Release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
on: workflow_dispatch | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- run: bun ci | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
files: | | ||
main.js | ||
styles.css | ||
manifest.json | ||
manifest-beta.json | ||
- name: "Discord notification (not success)" | ||
uses: rjstone/discord-webhook-notify@v1 | ||
if: "! success()" | ||
with: | ||
description: "⚠ Silhouette Release failed!" | ||
details: "${{ github.ref }}" | ||
severity: error | ||
avatarUrl: https://www.suruga-ya.jp/database/pics_light/game/871005085.jpg | ||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} | ||
|
||
notify: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Discord notification (success)" | ||
uses: rjstone/discord-webhook-notify@v1 | ||
if: always() | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: npm i -D --no-save conventional-changelog-conventionalcommits @semantic-release/git @semantic-release/exec | ||
- uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
description: "🚀 Silhouette Release finished!" | ||
details: "${{ github.ref }}" | ||
severity: info | ||
avatarUrl: https://www.suruga-ya.jp/database/pics_light/game/871005085.jpg | ||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} | ||
semantic_version: 24.2.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
export default { | ||
branches: ["master"], | ||
// Obsidianプラグインはgit tagにvをつけてはいけないのでtagFormatを変更 | ||
tagFormat: "${version}", | ||
plugins: [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
preset: "conventionalcommits", | ||
releaseRules: [ | ||
{ breaking: true, release: "minor" }, // TODO: v1になったら release: "major" にする | ||
{ type: "feat", release: "minor" }, | ||
{ type: "build", release: "minor" }, | ||
{ type: "style", release: "minor" }, | ||
{ type: "fix", release: "patch" }, | ||
{ type: "refactor", release: "patch" }, | ||
{ revert: true, release: "patch" }, | ||
], | ||
}, | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
preset: "conventionalcommits", | ||
presetConfig: { | ||
types: [ | ||
{ type: "feat", section: "✨ Features" }, | ||
{ type: "style", section: "🎨 Styles" }, | ||
{ type: "fix", section: "🛡 Bug Fixes" }, | ||
{ type: "build", section: "🤖 Build" }, | ||
{ type: "docs", hidden: true }, | ||
{ type: "refactor", hidden: true }, | ||
{ type: "test", hidden: true }, | ||
{ type: "ci", hidden: true }, | ||
{ type: "dev", hidden: true }, | ||
{ type: "chore", hidden: true }, | ||
], | ||
}, | ||
}, | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
// リリース作業直前にCIでビルド・テストを行い、version-bump.mtsでバージョン更新処理を行う. ${nextRelease.version}はsemantic-releaseが決めたバージョン | ||
prepareCmd: "bun ci && bun version-bump.mts ${nextRelease.version}", | ||
}, | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
// Obsidianプラグインとして配布する必要のあるファイルを記載 | ||
assets: [ | ||
"main.js", | ||
"styles.css", | ||
"manifest.json", | ||
"manifest-beta.json", | ||
], | ||
}, | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
// bun version-bump.mts で変更されたファイルすべてをコミット対象とする | ||
assets: [ | ||
"package.json", | ||
"manifest-beta.json", | ||
"manifest.json", | ||
"versions.json", | ||
"bun.lockb", | ||
], | ||
message: | ||
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}", | ||
}, | ||
], | ||
], | ||
}; |
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