Skip to content

Commit 8bc1793

Browse files
committed
Getting closer see #43
1 parent 73dec33 commit 8bc1793

File tree

3 files changed

+64
-11
lines changed

3 files changed

+64
-11
lines changed

.github/workflows/build.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ env:
3232
VTK_6_3_0_VS2017_X64_URL: https://github.com/MODFLOW-USGS/modelviewer-mf6/releases/download/vtk-6.3.0-vs2017-x64/vtk-6.3.0-vs2017-x64.7z
3333
HTMLHELP_URL: http://web.archive.org/web/20160201063255/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe
3434
SEM_VER_REGEX: ^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
35+
DIST_DIR: mvmf6-1.0.0 # automate this later
3536

3637
jobs:
3738

@@ -235,21 +236,15 @@ jobs:
235236
run: cmake --build --preset vs2019 --config release
236237

237238
- name: Install
238-
env:
239-
DIST_DIR: mvmf6-1.0.0-rc.1 # automate this later
240239
shell: pwsh
241240
run: cmake --install _vs2019 --prefix ${{env.DIST_DIR}} --config release
242241

243242
- name: Build mvmf6 zip
244-
env:
245-
DIST_DIR: mvmf6-1.0.0-rc.1 # automate this later
246243
run: |
247244
Copy-Item .\Help\mvmf6.chm ${{env.DIST_DIR}}\bin\.
248245
7z a -tzip ${{env.DIST_DIR}}.zip .\${{env.DIST_DIR}}\
249246
250247
- name: Create artifact
251-
env:
252-
DIST_DIR: mvmf6-1.0.0-rc.1 # automate this later
253248
uses: actions/upload-artifact@v3
254249
with:
255250
name: dist

ModelViewer/ModelViewer.rc

+5-5
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ BEGIN
770770
ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20
771771
LTEXT "Model Viewer for Modflow 6",IDC_MV_VERSION,45,7,107,10,SS_NOPREFIX
772772
LTEXT "Version 1.0.0",IDC_STATIC,45,20,107,10
773-
LTEXT "04/12/2022 (compiled Apr 12 2022 12:12:39)",IDC_MV_RELEASE,45,33,128,8
773+
LTEXT "04/12/2022 (compiled Apr 12 2022 13:26:55)",IDC_MV_RELEASE,45,33,128,8
774774
GROUPBOX "Notice",IDC_STATIC,7,47,204,49
775775
LTEXT "This software uses the Visualization Toolkit (vtk), written and copyrighted by Ken Martin, Will Schroeder and Bill Lorensen. The authors of vtk have granted permission to use, copy, and distribute vtk while retaining their copyright. ",IDC_STATIC,15,59,191,34
776776
GROUPBOX "Disclaimer",IDC_STATIC,7,98,204,119
@@ -1550,8 +1550,8 @@ END
15501550
//
15511551

15521552
VS_VERSION_INFO VERSIONINFO
1553-
FILEVERSION 1,0,12,64
1554-
PRODUCTVERSION 1,0,12,64
1553+
FILEVERSION 1,0,0,77
1554+
PRODUCTVERSION 1,0,0,77
15551555
FILEFLAGSMASK 0x3fL
15561556
#ifdef _DEBUG
15571557
FILEFLAGS 0x1L
@@ -1568,12 +1568,12 @@ BEGIN
15681568
BEGIN
15691569
VALUE "CompanyName", "USGS"
15701570
VALUE "FileDescription", "Model Viewer for Modflow 6"
1571-
VALUE "FileVersion", "1.0.12.64"
1571+
VALUE "FileVersion", "1.0.0.77"
15721572
VALUE "InternalName", "Model Viewer for Modflow 6"
15731573
VALUE "LegalCopyright", "public domain"
15741574
VALUE "OriginalFilename", "mvmf6.exe"
15751575
VALUE "ProductName", "Model Viewer for Modflow 6"
1576-
VALUE "ProductVersion", "1.0.12.64"
1576+
VALUE "ProductVersion", "1.0.0.77"
15771577
END
15781578
END
15791579
BLOCK "VarFileInfo"

misc/set_versions.ps1

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# create headers dictionary
2+
# $h = @{"Authorization" = "token ${{secrets.GITHUB_TOKEN}}"}
3+
4+
# try {
5+
# $response = Invoke-WebRequest -Uri ${{env.RELEASES_URL}}/latest -Headers $h -Method GET
6+
# $json = $response.Content | ConvertFrom-Json
7+
# $tag_name = $json.tag_name
8+
# }
9+
# catch {
10+
# # none so far
11+
# $tag_name = "0.0"
12+
# }
13+
14+
# $next_version = "1.0.0"
15+
# if ($tag_name -match '(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)(?:\.(?<patch>0|[1-9]\d*))?$') {
16+
# if ($Matches.ContainsKey('patch')) {
17+
# $patch = 1 + $Matches['patch']
18+
# }
19+
# else {
20+
# $patch = 0
21+
# }
22+
# $next_version = $Matches['major'] + "." + $Matches['minor'] + "." + $patch
23+
# }
24+
25+
# major.minor.patch.build
26+
27+
##$build = ${{github.run_number}}
28+
$next_version = "1.0.0"
29+
$build = "77"
30+
31+
$fullversion = "$next_version.$build"
32+
$fullversion_commas = $fullversion.Replace(".", ",")
33+
$date_compiled = "$((Get-Date -UFormat '%m/%d/%Y (compiled %b %d %Y %T)'))"
34+
35+
# sed CMakeLists.txt
36+
$file = ".\CMakeLists.txt"
37+
(Get-Content $file) | Foreach-Object {
38+
$_ -replace 'VERSION (?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)(?:\.(?<patch>0|[1-9]\d*))', "VERSION $next_version"
39+
} | Set-Content $file
40+
41+
# sed ModelViewer.rc
42+
$file = ".\ModelViewer\ModelViewer.rc"
43+
(Get-Content $file) | Foreach-Object {
44+
$_ -replace 'Version (?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)(?:\.(?<patch>0|[1-9]\d*))', "Version $next_version"`
45+
-replace 'FILEVERSION (?<major>0|[1-9]\d*),(?<minor>0|[1-9]\d*),(?<patch>0|[1-9]\d*),(?<build>0|[1-9]\d*)', "FILEVERSION $fullversion_commas"`
46+
-replace 'PRODUCTVERSION (?<major>0|[1-9]\d*),(?<minor>0|[1-9]\d*),(?<patch>0|[1-9]\d*),(?<build>0|[1-9]\d*)', "PRODUCTVERSION $fullversion_commas"`
47+
-replace 'VALUE "FileVersion", "(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d)\.(?<patch>0|[1-9]\d*)\.(?<build>0|[1-9]\d*)"', "VALUE ""FileVersion"", ""$fullversion"""`
48+
-replace 'VALUE "ProductVersion", "(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d)\.(?<patch>0|[1-9]\d*)\.(?<build>0|[1-9]\d*)"', "VALUE ""ProductVersion"", ""$fullversion"""`
49+
-replace '"(?<month>[0-1][1-9])\/(?<day>[0-3][1-9])\/(?<year>\d{4}) \(.*\)"', """$date_compiled"""`
50+
} | Set-Content $file
51+
52+
# set env for remaining steps
53+
if ($env:GITHUB_REPOSITORY -eq 'MODFLOW-USGS/modelviewer-mf6') {
54+
Write-Output "DIST_DIR=mvmf6-$next_version" >> $env:GITHUB_ENV
55+
} else {
56+
Write-Output "DIST_DIR=mvmf6-$env:GITHUB_REPOSITORY_OWNER-$next_version" >> $env:GITHUB_ENV
57+
}
58+
Write-Output "NEXT_VERSION=$next_version" >> $env:GITHUB_ENV

0 commit comments

Comments
 (0)