Skip to content

Commit efce015

Browse files
Merge pull request SkylineCommunications#22 from SkylineCommunications/MakingConnectorWorkflowPublic
Making connector workflow public
2 parents b3f38ca + 2a053c4 commit efce015

4 files changed

+157
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "DataMiner CICD Connector Deploy Only",
3+
"description": "Starter Workflow for CD only with a Skyline formatted Connector (aka protocol, driver) repository. Warning: avoid using this for stable releases. Use CI/CD for that.",
4+
"filePatterns": [
5+
"protocol.xml",
6+
"QActions",
7+
"DLLs"
8+
]
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: DataMiner CICD Connector Deploy Only
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches: []
8+
tags:
9+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+"
10+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+-**"
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16+
jobs:
17+
18+
# Optional 0 or More CD Jobs as needed
19+
CD:
20+
# if: github.ref_type == 'tag'
21+
environment: development
22+
name: CD
23+
runs-on: windows-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Install DataMiner Deploy
28+
run:
29+
30+
- name: Install .NET Tools
31+
run: |
32+
dotnet tool install -g Skyline.DataMiner.CICD.Tools.Packager
33+
dotnet tool install -g Skyline.DataMiner.CICD.Tools.DataMinerDeploy
34+
35+
#ON RELEASE OR PRE-RELEASE
36+
- name: Create DMAPP - Release
37+
if: inputs.referenceType == 'tag'
38+
run: dataminer-package-create dmprotocol "${{ github.workspace }}" --name "${{ github.repository }}_${{ github.ref_name }}" --output "${{ github.workspace }}/_PackageResults" --version-override "${{ github.ref_name }}"
39+
40+
#ON BUILD
41+
- name: Find and extract Protocol Version
42+
if: inputs.referenceType != 'tag'
43+
run: |
44+
# Find the protocol.xml file
45+
xml_file=$(find "${{ github.workspace }}" -maxdepth 1 -name "protocol.xml" -or -name "Protocol.xml" | head -n 1)
46+
47+
# Extract the Protocol Version using awk and store it in a variable
48+
protocol_version=$(awk -F '[><]' '/<Version>/ {print $3}' "$xml_file")
49+
50+
51+
# Print the extracted version for verification
52+
echo "Extracted Protocol Version: $protocol_version"
53+
54+
# Set the extracted version as an environment variable for future use
55+
echo "PROTOCOL_VERSION=$protocol_version" >> $GITHUB_ENV
56+
shell: bash
57+
58+
- name: Create DMAPP - Build
59+
if: inputs.referenceType != 'tag'
60+
run: |
61+
dataminer-package-create dmprotocol "${{ github.workspace }}" --name "${{ github.repository }}_${{ github.run_number }}" --output "${{ github.workspace }}/_PackageResults" --version-override "${{ env.PROTOCOL_VERSION }}_B${{ github.run_number }}"
62+
shell: bash
63+
64+
# Deploys the artifact directly to an internet-accessible DataMiner Agent.
65+
- name: Find .dmprotocol
66+
id: findcreatedpackage
67+
run: |
68+
IFS=$'\n'
69+
echo packageName=$(find _PackageResults -type f -name '*.dmprotocol') >> $GITHUB_OUTPUT
70+
unset IFS
71+
shell: bash
72+
73+
- name: Direct Agent Deployment
74+
run: dataminer-package-deploy from-artifact --path-to-artifact "${{ steps.findcreatedpackage.outputs.packageName }}" --dm-server-location "${{ secrets.serverLocation }}" --dm-user "${{ secrets.dataminerUser }}" --dm-password "${{ secrets.dataminerPassword }}"
75+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "DataMiner CICD Connector",
3+
"description": "Starter Workflow for CICD with a Skyline formatted Connector (aka protocol, driver) repository.",
4+
"filePatterns": [
5+
"protocol.xml",
6+
"QActions",
7+
"DLLs"
8+
]
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: DataMiner CICD Connector
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches: []
8+
tags:
9+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+"
10+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+-**"
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16+
jobs:
17+
18+
CI:
19+
uses: SkylineCommunications/_ReusableWorkflows/.github/workflows/Connector Master Workflow.yml@main
20+
with:
21+
referenceName: ${{ github.ref_name }}
22+
runNumber: ${{ github.run_number }}
23+
referenceType: ${{ github.ref_type }}
24+
repository: ${{ github.repository }}
25+
owner: ${{ github.repository_owner }}
26+
sonarCloudProjectName: #TODO: Go to 'https://sonarcloud.io/projects/create' and create a project. Then enter the id of the project as mentioned in the sonarcloud project url here.
27+
secrets:
28+
# The API-key: generated in the DCP Admin app (https://admin.dataminer.services/) as authentication for a certain DataMiner System.
29+
api-key: ${{ secrets.DATAMINER_DEPLOY_KEY }}
30+
sonarCloudToken: ${{ secrets.SONAR_TOKEN }}
31+
32+
# Optional 0 or More CD Jobs as needed
33+
# CD:
34+
# # if: github.ref_type == 'tag'
35+
# environment: staging
36+
# name: CD
37+
# runs-on: windows-latest
38+
# needs: CI
39+
40+
# steps:
41+
# - uses: actions/checkout@v4
42+
43+
# - name: Install DataMiner Deploy
44+
# run: dotnet tool install -g Skyline.DataMiner.CICD.Tools.DataMinerDeploy
45+
46+
# # Deploys the artifact directly to an internet-accessible DataMiner Agent. Deployment from the catalog currently not supported.
47+
# - name: Download Created Connector Package
48+
# id: downloadPackage
49+
# uses: actions/download-artifact@v4
50+
# with:
51+
# name: Connector Package
52+
# path: _PackageResults
53+
54+
# - name: Find .dmprotocol
55+
# id: findcreatedpackage
56+
# run: |
57+
# IFS=$'\n'
58+
# echo packageName=$(find _PackageResults -type f -name '*.dmprotocol') >> $GITHUB_OUTPUT
59+
# unset IFS
60+
# shell: bash
61+
62+
# - name: Direct Agent Deployment
63+
# run: dataminer-package-deploy from-artifact --path-to-artifact "${{ steps.findcreatedpackage.outputs.packageName }}" --dm-server-location "${{ secrets.serverLocation }}" --dm-user "${{ secrets.dataminerUser }}" --dm-password "${{ secrets.dataminerPassword }}"
64+

0 commit comments

Comments
 (0)