Skip to content

Commit 6082346

Browse files
authored
Update build-artifact.yml
1 parent 04dede9 commit 6082346

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/build-artifact.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Build artifact.
22

33
on:
44
push:
5+
tags:
6+
- "v*"
57
branches: '*'
68
pull_request:
79
branches: '*'
810
workflow_dispatch:
9-
schedule:
10-
- cron: '0 0 1 * *'
1111

1212
jobs:
1313

@@ -21,6 +21,13 @@ jobs:
2121
with:
2222
submodules: recursive
2323

24+
# get version from pushed tag
25+
- name: Extract version
26+
if: startsWith(github.ref, 'refs/tags/v')
27+
id: version
28+
run: |
29+
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
30+
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}
2431
2532
# Install the .NET Core workload
2633
- name: Install .NET
@@ -48,3 +55,18 @@ jobs:
4855
name: "AmpHelper"
4956
path: publish/AmpHelper.CLI.Self-Contained/AmpHelper.exe
5057
retention-days: 90
58+
59+
# if we had a tag, we should make a release
60+
- name: Upload release artifacts
61+
if: startsWith(github.ref, 'refs/tags/v')
62+
id: upload_file_release
63+
uses: softprops/[email protected]
64+
with:
65+
tag_name: ${{ github.event.inputs.version }}
66+
draft: false
67+
generate_release_notes: true
68+
files: |
69+
./publish/AmpHelper.CLI.Self-Contained/AmpHelper.exe
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+

0 commit comments

Comments
 (0)