generated from exteraGramPlugins/pluginBase
Trigger the release workflow on pushes to main, not just on v* tags, so every push leaves a downloadable .plugin attached to the current version. The version in plugin.json decides what happens: a new version creates tag v<version> and a new release, while an unchanged version rebuilds the existing release and replaces its attachment. The tag is never moved, so it keeps pointing at the commit that first introduced that version, but the release notes are refreshed to name the commit the build came from. Hand-pushed v* tags and manual runs are unaffected and still use the tag verbatim.
This commit is contained in:
1 parent
196da742de
commit
aec9f9376f
3 files changed
+56
-21
No files matched your search
@@ -2,9 +2,13 @@ name: Publish plugin
|
||||
|
||||
# Builds dist/<id>.plugin and publishes it to the Releases tab.
|
||||
#
|
||||
# Triggers:
|
||||
# push a v* tag -> release named after that tag
|
||||
# manual dispatch -> release named v<version from plugin.json>
|
||||
# The version in plugin.json is the single source of truth:
|
||||
# new version -> a new v<version> tag and release are created
|
||||
# same version -> the existing release is rebuilt, replacing its attachment
|
||||
#
|
||||
# So a normal push to main always produces a downloadable build, and bumping
|
||||
# the version in plugin.json is what cuts a new release. Pushing a v* tag by
|
||||
# hand still works and uses that tag verbatim.
|
||||
#
|
||||
# dist/ is gitignored, so the artifact is always built here rather than
|
||||
# committed. The build uses --release because --dev embeds absolute paths from
|
||||
@@ -12,6 +16,8 @@ name: Publish plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
@@ -54,8 +60,11 @@ jobs:
|
||||
run: |
|
||||
set -eu
|
||||
if [ "${GITHUB_REF_TYPE:-}" = "tag" ]; then
|
||||
# Hand-pushed tag: honour it exactly as written.
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
else
|
||||
# Branch push or manual run: the version in plugin.json decides
|
||||
# whether this is a new release or a rebuild of the current one.
|
||||
tag="v${{ steps.build.outputs.version }}"
|
||||
fi
|
||||
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
Reference in new issue
Block a user