From 88d2629d8de4b99ec0aded3d1ef11c5b26880628 Mon Sep 17 00:00:00 2001 From: Fabian Schuh Date: Fri, 1 Dec 2023 11:43:32 +0100 Subject: [PATCH] fix(build): properly build assets for releases --- .gitignore | 46 ++++++++++++++++++++++++---------------------- dist/.empty | 0 package.json | 9 +++------ release.sh | 3 +++ 4 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 dist/.empty diff --git a/.gitignore b/.gitignore index e09a007..517790f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,24 @@ -# vscode -.vscode - -# Intellij -*.iml -.idea - -# npm -node_modules - -# Don't include the compiled main.js file in the repo. -# They should be uploaded to GitHub releases instead. -main.js - -# Exclude sourcemaps -*.map - -# obsidian -data.json - -# Exclude macOS Finder (System Explorer) View States -.DS_Store +# vscode +.vscode + +# Intellij +*.iml +.idea + +# npm +node_modules + +# Don't include the compiled main.js file in the repo. +# They should be uploaded to GitHub releases instead. +main.js + +# Exclude sourcemaps +*.map + +# obsidian +data.json + +# Exclude macOS Finder (System Explorer) View States +.DS_Store + +dist/release.zip diff --git a/dist/.empty b/dist/.empty new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index f4ef9b6..33afcdc 100644 --- a/package.json +++ b/package.json @@ -62,12 +62,9 @@ "addReleases": true, "assets": [ { - "path": [ - "main.js", - "manifest.json", - "styles.css" - ], - "label": "Plugin Release" + "path": "dist/release.zip", + "name": "obsidian-plugin-${nextRelease.gitTag}.zip", + "label": "Obsidian Plugin Bundle (${nextRelease.gitTag})" } ] } diff --git a/release.sh b/release.sh index 0ea64c4..f7ab21a 100755 --- a/release.sh +++ b/release.sh @@ -10,3 +10,6 @@ fi TEMPFILE=$(mktemp) cp versions.json $TEMPFILE jq '."'$1'" = "'$REQUIRED_OBSIDIAN_VERSION'"' $TEMPFILE >versions.json + +# Now lets zip the files +zip dist/release.zip main.js manifest.json styles.css