From bfa1cd907c623b5ca9481aca70da950ab4059e7f Mon Sep 17 00:00:00 2001 From: Exidex <16986685+Exidex@users.noreply.github.com> Date: Sun, 20 Oct 2024 20:08:49 +0200 Subject: [PATCH] Fix publish failing if no current-version tag exists --- CHANGELOG.md | 3 +++ src/publish.ts | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a05fc..74f32fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ For changes in main application see [separate CHANGELOG.md](https://github.com/p The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to Semantic Versioning Convention +## [0.9.0] - 2024-10-20 +- Fixed `publish` failing if no `current-version` tag exists on remote + ## [0.8.0] - 2024-10-13 - Added `entrypoint.icon` plugin manifest property that accepts path to image inside plugin's `assets` directory - **BREAKING CHANGE**: Plugin permissions reworked. See [main application CHANGELOG.md](https://github.com/project-gauntlet/gauntlet/blob/main/CHANGELOG.md) for version v10 diff --git a/src/publish.ts b/src/publish.ts index bf8362f..000a51d 100644 --- a/src/publish.ts +++ b/src/publish.ts @@ -75,8 +75,12 @@ export async function publish() { console.log("Tagging current version...") await cloneGit.raw('tag', '--force', 'current-version', commitHash) - console.log("Removing remote tag...") - await cloneGit.push(['--set-upstream', '--delete', 'origin', 'current-version']) + try { + console.log("Removing remote tag...") + await cloneGit.push(['--set-upstream', '--delete', 'origin', 'current-version']) + } catch (ignore) { + // this failing means tag doesn't exist on remote + } console.log("Pushing to 'origin' remote...") // push