1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-05-06 20:55:49 +05:30

Allow manual workflow dispatches for tesitng

This commit is contained in:
talynone
2026-04-27 01:57:23 -07:00
Unverified
parent 96eebb84cc
commit 2a7aa2ab5a

View File

@@ -2,6 +2,12 @@ on:
push: push:
tags: tags:
- 'v*.*.*' - 'v*.*.*'
workflow_dispatch:
inputs:
tag_name:
description: 'Draft release tag (e.g. v0.4.5-test)'
required: true
default: 'v0.0.0-test'
name: 🚀 Release on GitHub name: 🚀 Release on GitHub
jobs: jobs:
@@ -64,11 +70,11 @@ jobs:
run: | run: |
if [ -f CHANGELOG.md ]; then if [ -f CHANGELOG.md ]; then
# Extract version number from tag # Extract version number from tag
VERSION_NUM=$(echo "${{ github.ref_name }}" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+)(-.*)?$/\1/') VERSION_NUM=$(echo "${{ inputs.tag_name || github.ref_name }}" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+)(-.*)?$/\1/')
# Read and replace placeholders # Read and replace placeholders
CONTENT=$(cat CHANGELOG.md) CONTENT=$(cat CHANGELOG.md)
CONTENT=${CONTENT//<release_tag>/${{ github.ref_name }}} CONTENT=${CONTENT//<release_tag>/${{ inputs.tag_name || github.ref_name }}}
CONTENT=${CONTENT//<version>/$VERSION_NUM} CONTENT=${CONTENT//<version>/$VERSION_NUM}
echo "content<<EOF" >> $GITHUB_OUTPUT echo "content<<EOF" >> $GITHUB_OUTPUT
@@ -85,11 +91,11 @@ jobs:
run: | run: |
if (Test-Path "CHANGELOG.md") { if (Test-Path "CHANGELOG.md") {
# Extract version number from tag # Extract version number from tag
$version_num = "${{ github.ref_name }}" -replace '^v([0-9]+\.[0-9]+\.[0-9]+)(-.*)?$','$1' $version_num = "${{ inputs.tag_name || github.ref_name }}" -replace '^v([0-9]+\.[0-9]+\.[0-9]+)(-.*)?$','$1'
# Read and replace placeholders # Read and replace placeholders
$content = Get-Content -Path CHANGELOG.md -Raw $content = Get-Content -Path CHANGELOG.md -Raw
$content = $content -replace '<release_tag>', "${{ github.ref_name }}" $content = $content -replace '<release_tag>', "${{ inputs.tag_name || github.ref_name }}"
$content = $content -replace '<version>', "$version_num" $content = $content -replace '<version>', "$version_num"
"content<<EOF" >> $env:GITHUB_OUTPUT "content<<EOF" >> $env:GITHUB_OUTPUT
@@ -106,8 +112,8 @@ jobs:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with: with:
tagName: ${{ github.ref_name }} tagName: ${{ inputs.tag_name || github.ref_name }}
releaseName: ${{ github.event.repository.name }}-${{ github.ref_name }} releaseName: ${{ github.event.repository.name }}-${{ inputs.tag_name || github.ref_name }}
releaseBody: ${{ (matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm') && steps.changelog_windows.outputs.content || steps.changelog_unix.outputs.content }} releaseBody: ${{ (matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm') && steps.changelog_windows.outputs.content || steps.changelog_unix.outputs.content }}
releaseDraft: true releaseDraft: true
prerelease: false prerelease: false