Allow to trigger releases from a workflow (#3150)

This commit is contained in:
Paul Woitaschek
2025-10-02 09:17:19 +02:00
committed by GitHub
parent 1676161d67
commit a1776d7658
3 changed files with 44 additions and 5 deletions

32
.github/workflows/trigger_release.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Trigger Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout (with tags)
uses: actions/checkout@v4
with:
# We need the tags to determine the next release
fetch-depth: 0
fetch-tags: true
# We need the credentials to push the tag
persist-credentials: true
- name: Configure git author
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Run release script (non-interactive)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/release.main.kts

2
.gitignore vendored
View File

@@ -23,3 +23,5 @@ releases
/.idea/deviceManager.xml
/fastlane/README.md
/fastlane/report.xml
/.idea/copilot.data.migration.ask.xml
/.idea/copilot.data.migration.ask2agent.xml

View File

@@ -120,16 +120,21 @@ class Release : CliktCommand() {
}
echo("Tagging git with $newVersionName-$newVersionCode")
gitTag(newVersion)
val shouldPush = YesNoPrompt(
prompt = "Push tags to remote",
terminal = terminal,
default = true,
).ask() ?: false
val shouldPush = confirmPush()
if (shouldPush) {
gitPush()
}
}
private fun confirmPush(): Boolean {
if (System.getenv("CI") == "true") return true
return YesNoPrompt(
prompt = "Push tags to remote",
terminal = terminal,
default = true,
).ask() ?: false
}
}
Release().main(args)