mirror of
https://github.com/PaulWoitaschek/Voice.git
synced 2026-03-13 08:02:45 +08:00
Allow to trigger releases from a workflow (#3150)
This commit is contained in:
32
.github/workflows/trigger_release.yml
vendored
Normal file
32
.github/workflows/trigger_release.yml
vendored
Normal 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
2
.gitignore
vendored
@@ -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
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user