Add ability to make release locally

This commit is contained in:
Markus Moser 2025-01-16 14:11:18 +01:00
parent f1530b598b
commit f7a8b38608
No known key found for this signature in database
GPG key ID: AD411FF94FFE07BD
4 changed files with 18 additions and 7 deletions

12
.github/make_release.sh vendored Normal file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env sh
PLUGIN_NAME=${1:-${PWD##*/}}
rm -r ${PLUGIN_NAME}
mkdir ${PLUGIN_NAME}
for f in main.js manifest.json styles.scss styles.css; do
if [[ -f $f ]]; then
cp $f "${PLUGIN_NAME}/"
fi
done
zip -r "${PLUGIN_NAME}".zip "$PLUGIN_NAME"

View file

@ -27,13 +27,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLUGIN_NAME: ${{ github.event.repository.name }}
run: |
mkdir ${PLUGIN_NAME}
for f in main.js manifest.json styles.scss styles.css; do
if [[ -f $f ]]; then
cp $f "${PLUGIN_NAME}/"
fi
done
zip -r "${PLUGIN_NAME}".zip "$PLUGIN_NAME"
sh ./.github/make_release.sh ${PLUGIN_NAME}
tag="${GITHUB_REF#refs/tags/}"
gh release create "$tag" --generate-notes ${PLUGIN_NAME}.zip

4
.gitignore vendored
View file

@ -22,3 +22,7 @@ data.json
# Exclude macOS Finder (System Explorer) View States
.DS_Store
# Exclude release
obsidian-private-mode/
obsidian-private-mode.zip

View file

@ -6,6 +6,7 @@
"scripts": {
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production && sass styles.scss styles.css",
"make-release": "npm run build && bash ./.github/make_release.sh obsidian-private-mode",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"lint": "eslint --cache --fix"
},