Skip to content

Commit d9dc454

Browse files
committed
Update Github Release step to use the reusable workflow
1 parent 4bb642e commit d9dc454

File tree

1 file changed

+7
-85
lines changed

1 file changed

+7
-85
lines changed

.github/workflows/dataminer-cicd-automation.yml

+7-85
Original file line numberDiff line numberDiff line change
@@ -29,98 +29,20 @@ jobs:
2929
api-key: ${{ secrets.DATAMINER_DEPLOY_KEY }}
3030
sonarCloudToken: ${{ secrets.SONAR_TOKEN }}
3131

32-
Release:
32+
CD:
33+
uses: ArneMaes0/ReusableWorkflows/.github/workflows/Release With DMAPP Artifact.yml@main
3334
if: github.ref_type == 'tag'
34-
runs-on: ubuntu-latest
3535
needs: CI
36-
permissions:
36+
permissions:
3737
contents: write
38-
steps:
39-
- name: Checkout Code
40-
uses: actions/checkout@v4
41-
42-
- name: Check Release
43-
id: release_check
44-
run: |
45-
REF_NAME="${{ github.ref_name }}"
46-
RELEASE_REGEX="^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$"
47-
PRE_RELEASE_REGEX="^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-[0-9a-zA-Z]+$"
48-
if [[ $REF_NAME =~ $RELEASE_REGEX ]]
49-
then
50-
echo "prerelease=false" >> $GITHUB_OUTPUT
51-
echo "Release"
52-
exit 0
53-
elif [[ $REF_NAME =~ $PRE_RELEASE_REGEX ]]
54-
then
55-
echo "prerelease=true" >> $GITHUB_OUTPUT
56-
echo "Pre-Release"
57-
exit 0
58-
else
59-
echo "Tag is in the incorrect format. Should be 0.0.0.0 for a release or 0.0.0.0-someprereleasetag for a pre-release."
60-
exit 1
61-
fi
62-
63-
- name: Check Changelog
64-
id: changelog_check
65-
if: steps.release_check.outputs.prerelease == 'false'
66-
run: |
67-
FILE=./Documentation/CHANGELOG_${{ github.ref_name }}.md
68-
echo "$FILE"
69-
if [ -f "$FILE" ]
70-
then
71-
echo "changelog_exists=true" >> $GITHUB_OUTPUT
72-
echo "changelog_file=$FILE" >> $GITHUB_OUTPUT
73-
exit 0
74-
else
75-
echo "There is no changelog found for tag $FILE. Please add a CHANGELOG_$FILE.md file with the changes for this version in the Documentation folder."
76-
exit 1
77-
fi
78-
79-
- name: Retrieve Installation Package
80-
id: retrieveInstallationPackage
81-
uses: actions/download-artifact@v4
82-
with:
83-
name: DataMiner Installation Package
84-
path: _DataMinerInstallationPackage
85-
86-
- name: Find Installation Package
87-
id: findInstallationPackage
88-
run: |
89-
path=$(find _DataMinerInstallationPackage -type f -name '*.dmapp')
90-
echo $path
91-
92-
if [ ! -z "$path" ]
93-
then
94-
newpath="${path%.*}_${{ github.ref_name }}.dmapp"
95-
echo $newpath
96-
mv $path $newpath
97-
echo "dmappPackageName=$newpath" >> $GITHUB_OUTPUT
98-
else
99-
exit 1
100-
echo "dmappPackageName=""" >> $GITHUB_OUTPUT
101-
fi
102-
103-
- name: Logging
104-
run: |
105-
echo ${{ steps.changelog_check.outputs.changelog_exists }}
106-
echo ${{ steps.changelog_check.outputs.changelog_file }}
107-
echo ${{ steps.release_check.outputs.prerelease }}
108-
echo ${{ steps.findInstallationPackage.outputs.dmappPackageName }}
109-
110-
- name: Create Release
111-
uses: ncipollo/release-action@v1
112-
with:
113-
name: ${{ github.ref_name }}
114-
bodyFile: ${{ steps.changelog_check.outputs.changelog_file }}
115-
draft: false
116-
prerelease: ${{ steps.release_check.outputs.prerelease == 'true' }}
117-
allowUpdates: true
118-
artifacts: ${{ steps.findInstallationPackage.outputs.dmappPackageName }}
38+
with:
39+
referenceName: ${{ github.ref_name }}
40+
referenceType: ${{ github.ref_type }}
41+
changelogDirectory: Documentation
11942

12043
# # Optional 0 or More CD Jobs as needed
12144
# CD:
12245
# if: github.ref_type == 'tag'
123-
# environment: production
12446
# name: CD
12547
# runs-on: ubuntu-latest
12648
# needs: CI

0 commit comments

Comments
 (0)