-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclarion-build.yml
More file actions
171 lines (134 loc) · 6.42 KB
/
clarion-build.yml
File metadata and controls
171 lines (134 loc) · 6.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Clarion Build
on:
push:
branches:
# Branches that this action will run, probably not a good idea on master :)
- master
jobs:
build:
runs-on: windows-latest
steps:
- name: Install Git LFS
run: |
git lfs install --skip-repo
git lfs version
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Pull from Private Repository
uses: actions/checkout@v3
with:
repository: username/ClarionRepositoryName
path: clarion
ref: master
token: ${{ secrets.GITHUBSECRET }}
lfs: true
- name: Modify ClarionProperties.xml
run: |
$clarionPropertiesPath = "${{ github.workspace }}/appdata/ClarionProperties.xml"
$backupPath = "${{ github.workspace }}/appdata/ClarionProperties.xml.bak"
# Backup ClarionProperties.xml
Copy-Item -Path $clarionPropertiesPath -Destination $backupPath -Force
# Read the contents of the ClarionProperties.xml file
$clarionPropertiesContent = Get-Content -Path $clarionPropertiesPath
# Define the replacement value
$replacement = "$($env:GITHUB_WORKSPACE)\clarion"
# Replace references to C:\clarion\clarion11 with $env:GITHUB_WORKSPACE path
$modifiedContent = $clarionPropertiesContent -replace 'C:\\clarion\\clarion11', $replacement
# Save the modified content back to the ClarionProperties.xml file
$modifiedContent > $clarionPropertiesPath
# Copy the backup file back to the original path
Copy-Item -Path $clarionPropertiesPath -Destination $backupPath -Force
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Add the modified file to the git index
git add $backupPath
# Commit the changes with a specific message
git commit -m "Rebackup of ClarionProperties.xml on failure"
# Push the changes to the repository
git push
- name: Setup .NET Framework 4.6
run: |
choco install dotnet4.6 --ignore-checksums -y
refreshenv
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Generate txa files, they will be namned UPS
run: |
$claInterfacePath = "${{ github.workspace }}\clarion\clainterface\ClaInterface.exe"
$arguments = "COMMAND=BUILDAPP INPUT=${{ github.workspace }}\vcTestWorkflow OUTPUT=${{ github.workspace }}"
# Start the process in the background
Start-Process -FilePath $claInterfacePath -ArgumentList $arguments -NoNewWindow -PassThru
# Wait for the process to complete
Wait-Process -Name ClaInterface
- name: Import txa files, only way to do this is list them
run: |
${{ github.workspace }}/clarion/bin/clarioncl.exe /ConfigDir "${{ github.workspace }}/appdata" /up_createappVC ${{ github.workspace }}\Helloworld.sln ${{ github.workspace }}\data.ups data
${{ github.workspace }}/clarion/bin/clarioncl.exe /ConfigDir "${{ github.workspace }}/appdata" /up_createappVC ${{ github.workspace }}\Helloworld.sln ${{ github.workspace }}\HelloWorld.ups HelloWorld
- name: Generate Applications
run: |
${{ github.workspace }}/clarion/bin/clarioncl.exe /ConfigDir "${{ github.workspace }}\appdata" /ag "${{ github.workspace }}\Helloworld.sln"
- name: Build Clarion project
run: |
msbuild data.cwproj `
/property:GenerateFullPaths=true `
/t:build `
/m `
/consoleloggerparameters:NoSummary `
/property:Configuration=Debug `
/property:clarion_Sections=Debug `
/property:SolutionDir=${{ github.workspace }} `
/property:ClarionBinPath="Clarion\Bin" `
/property:NoDependency=true `
/property:Verbosity=diagnostic `
/property:WarningLevel=1 `
msbuild HelloWorld.cwproj `
/property:GenerateFullPaths=true `
/t:build `
/m `
/consoleloggerparameters:NoSummary `
/property:Configuration=Debug `
/property:clarion_Sections=Debug `
/property:SolutionDir=${{ github.workspace }} `
/property:ClarionBinPath="Clarion\Bin" `
/property:NoDependency=true `
/property:Verbosity=diagnostic `
/property:WarningLevel=1 `
- name: Restore ClarionProperties.xml
run: |
$clarionPropertiesPath = "${{ github.workspace }}/appdata/ClarionProperties.xml"
$backupPath = "${{ github.workspace }}/appdata/ClarionProperties.xml.bak"
# Copy the backup file back to the original path
Copy-Item -Path $backupPath -Destination $clarionPropertiesPath -Force
- name: Create Build Directory
run: |
$buildDirectory = "${{ github.workspace }}/build"
if (-not (Test-Path $buildDirectory)) {
New-Item -ItemType Directory -Path $buildDirectory
}
- name: Zip Contents
run: |
$sourceDirectory = "${{ github.workspace }}/working"
$zipFileName = "Build-$(Get-Date -Format 'yyyy-MM-dd-HH-mm').zip"
$zipPath = "${{ github.workspace }}/build/$zipFileName"
Compress-Archive -Path $sourceDirectory -DestinationPath $zipPath
- name: Copy Zip to Build Directory
run: |
$sourcePath = "${{ github.workspace }}/Build-*.zip"
$destinationDirectory = "${{ github.workspace }}/build"
$destinationPath = Join-Path $destinationDirectory (Get-ChildItem -Path $sourcePath).Name
Copy-Item -Path $sourcePath -Destination $destinationPath -Force
- name: Disable Git LFS
run: |
git lfs uninstall --skip-repo
- name: Commit changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add -A
git reset clarion # Exclude the clarion directory from the commit
git commit -m "Update files"
- name: Push changes
run: git push