Skip to content

Commit 9d18844

Browse files
committed
feat: Add version retrieval and draft release creation to build workflow
1 parent 497d22b commit 9d18844

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,25 @@ jobs:
4343
with:
4444
name: DUCE-windows-package
4545
path: ./dist/
46+
47+
- name: Get Version
48+
if: github.event_name == 'workflow_dispatch'
49+
id: get_version
50+
shell: pwsh
51+
run: |
52+
$version = (Select-String -Path .\base.py -Pattern 'VERSION = "(v.*?)"').Matches.Groups[1].Value
53+
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
54+
echo "TAG=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
55+
56+
- name: Create Draft Release and Tag
57+
if: github.event_name == 'workflow_dispatch'
58+
uses: softprops/action-gh-release@v2
59+
with:
60+
tag_name: ${{ steps.get_version.outputs.TAG }}
61+
name: ${{ steps.get_version.outputs.TAG }}
62+
body: |
63+
Draft release for version ${{ steps.get_version.outputs.TAG }}
64+
draft: true
65+
prerelease: false
66+
files: |
67+
./dist/*

0 commit comments

Comments
 (0)