Skip to content

Commit aa5af2d

Browse files
committed
release action
1 parent 367adfd commit aa5af2d

File tree

1 file changed

+42
-23
lines changed

1 file changed

+42
-23
lines changed

.github/workflows/DataMiner+CI+Automation.yml

+42-23
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ on:
77
- '[0-9]+.[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+'
88
workflow_dispatch:
99
jobs:
10-
CI:
11-
name: CI
12-
uses: SkylineCommunications/_ReusableWorkflows/.github/workflows/Automation Master Workflow.yml@main
13-
with:
14-
referenceName: ${{ github.ref_name }}
15-
runNumber: ${{ github.run_number }}
16-
referenceType: ${{ github.ref_type }}
17-
repository: ${{ github.repository }}
18-
owner: ${{ github.repository_owner }}
19-
sonarCloudProjectName: qsdqsd
20-
secrets:
21-
api-key: ${{ secrets.DATAMINER_DEPLOY_KEY }}
22-
sonarCloudToken: ${{ secrets.SONAR_TOKEN }}
10+
# CI:
11+
# name: CI
12+
# uses: SkylineCommunications/_ReusableWorkflows/.github/workflows/Automation Master Workflow.yml@main
13+
# with:
14+
# referenceName: ${{ github.ref_name }}
15+
# runNumber: ${{ github.run_number }}
16+
# referenceType: ${{ github.ref_type }}
17+
# repository: ${{ github.repository }}
18+
# owner: ${{ github.repository_owner }}
19+
# sonarCloudProjectName: qsdqsd
20+
# secrets:
21+
# api-key: ${{ secrets.DATAMINER_DEPLOY_KEY }}
22+
# sonarCloudToken: ${{ secrets.SONAR_TOKEN }}
2323

2424
Release:
2525
# if: github.ref_type == 'tag'
@@ -44,18 +44,37 @@ jobs:
4444
exit 1
4545
fi
4646
47+
- name: Check Release
48+
id: release_check
49+
run: |
50+
REF_NAME="${{ secrets.REF_NAME }}""
51+
RELEASE_REGEX="^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$"
52+
PRE_RELEASE_REGEX="^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-[0-9a-zA-Z]+$"
53+
if [[ $REF_NAME =~ $RELEASE_REGEX ]]
54+
then
55+
echo "prerelease=false" >> $GITHUB_OUTPUT
56+
exit 0
57+
elif [[ $REF_NAME =~ $PRE_RELEASE_REGEX ]]
58+
then
59+
echo "prerelease=true" >> $GITHUB_OUTPUT
60+
exit 0
61+
else
62+
exit 1
63+
fi
64+
4765
- name: Logging
4866
run: |
4967
echo ${{ steps.changelog_check.outputs.changelog_exists }}
5068
echo ${{ steps.changelog_check.outputs.changelog_file }}
69+
echo ${{ steps.release_check.outputs.prerelease }}
5170
52-
# - name: Create Release
53-
# uses: actions/create-release@v1
54-
# env:
55-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56-
# with:
57-
# tag_name: ${{ github.ref }}
58-
# release_name: ${{ github.ref }}
59-
# body_path: ${{ steps.changelog_check.outputs.changelog_file }}
60-
# draft: false
61-
# prerelease: false
71+
- name: Create Release
72+
uses: actions/create-release@v1
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
with:
76+
tag_name: ${{ github.ref }}
77+
release_name: ${{ github.ref }}
78+
body_path: ${{ steps.changelog_check.outputs.changelog_file }}
79+
draft: false
80+
prerelease: ${{ steps.release_check.outputs.prerelease == 'true' }}

0 commit comments

Comments
 (0)