8
8
# to restart build numbers from `1`. This is necessary because GitHub
9
9
# maintains build numbers per workflow file name.
10
10
#
11
- name : MaxMindDB v1.6.0 -1
11
+ name : MaxMindDB v1.7.1 -1
12
12
13
13
#
14
14
# When `publish-package` is set to `yes`, the workflow will build
30
30
workflow_dispatch :
31
31
inputs :
32
32
publish-package :
33
- description : Publish Nuget Package?
33
+ description : Publish Nuget Package (yes/no) ?
34
34
required : false
35
35
36
36
#
45
45
# adding or removing files, changing any text in README files, etc.
46
46
#
47
47
env :
48
- PKG_VER : 1.6.0
48
+ PKG_VER : 1.7.1
49
49
PKG_REV : 1
50
50
BUILD_NUMBER : ${{ github.run_number }}
51
51
52
- SRC_TAG : 1.6.0
52
+ #
53
+ # GitHub won't allow referencing `env` within this section, which
54
+ # means that in order to reference the source directory we need
55
+ # to concatenate variables in-place (e.g. `libmaxminddb-${{ env.PKG_VER }}`)
56
+ # or to define them in each step where the source directory is
57
+ # referenced.
58
+ #
59
+ MAXMIND_FNAME : libmaxminddb-%PKG_VER%
60
+ MAXMIND_SHA256 : e8414f0dedcecbc1f6c31cb65cd81650952ab0677a4d8c49cab603b3b8fb083e
53
61
54
62
# for VS Community Edition, replace `Enterprise` with `Community` in the path
55
63
VCVARSALL : ' C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall'
@@ -64,43 +72,37 @@ defaults:
64
72
jobs :
65
73
build-libmmdb :
66
74
name : Build libmaxminddb
67
- runs-on : windows-latest
75
+ runs-on : windows-2022
68
76
69
77
steps :
70
78
- name : Checkout
71
- uses : actions/checkout@v2
79
+ uses : actions/checkout@v3
72
80
73
- #
74
- # This project is set up with two sub-modules, one for tests
75
- # and one for test MMDB databases. This script explicitly
76
- # excludes tests from the CMake build, so we can get just the
77
- # main project.
78
- #
79
- - name : Clone libmaxminddb
80
- run : |
81
- git clone --branch ${{ env.SRC_TAG }} https://github.com/maxmind/libmaxminddb.git libmaxminddb
82
-
83
- - name : Create build directories
84
- working-directory : libmaxminddb
81
+ - name : Download libmaxminddb
85
82
run : |
86
- mkdir build-x64
87
- mkdir build-x86
83
+ curl --location --output ${{ env.MAXMIND_FNAME }}.tar.gz https://github.com/maxmind/libmaxminddb/releases/download/${{ env.PKG_VER }}/${{ env.MAXMIND_FNAME }}.tar.gz
84
+
85
+ - name : Verify libmaxminddb checksum
86
+ run : 7z h -scrcSHA256 ${{ env.MAXMIND_FNAME }}.tar.gz | findstr /C:"SHA256 for data" | call devops\check-sha256 "${{ env.MAXMIND_SHA256 }}"
88
87
89
88
- name : Build x64
90
- working-directory : libmaxminddb\build-x64
89
+ working-directory : ${{ env.MAXMIND_FNAME }}
91
90
run : |
92
91
call ${{ env.VCVARSALL }} x64
93
- cmake -DBUILD_TESTING=OFF -A x64 ..
94
- cmake --build . --config Debug
95
- cmake --build . --config Release
92
+ mkdir build\x64
93
+ cmake -S . -B build\x64 -DBUILD_TESTING=OFF -A x64
94
+ cmake --build build\x64 --config Debug
95
+ cmake --build build\x64 --config Release
96
96
97
+ # VCVARSALL is invoked only for tools and CMake sets the platform
97
98
- name : Build Win32
98
- working-directory : libmaxminddb\build-x86
99
+ working-directory : ${{ env.MAXMIND_FNAME }}
99
100
run : |
100
- call ${{ env.VCVARSALL }} x86
101
- cmake -DBUILD_TESTING=OFF -A Win32 ..
102
- cmake --build . --config Debug
103
- cmake --build . --config Release
101
+ call ${{ env.VCVARSALL }} x64
102
+ mkdir build\Win32
103
+ cmake -S . -B build\Win32 -DBUILD_TESTING=OFF -A Win32
104
+ cmake --build build\Win32 --config Debug
105
+ cmake --build build\Win32 --config Release
104
106
105
107
#
106
108
# Unfortunately, release builds are set up not to generate PDB,
@@ -109,38 +111,34 @@ jobs:
109
111
- name : Collect build artifacts
110
112
run : |
111
113
mkdir nuget\licenses\
112
- copy /Y libmaxminddb \LICENSE. nuget\licenses\
114
+ copy /Y ${{ env.MAXMIND_FNAME }} \LICENSE. nuget\licenses\
113
115
114
116
mkdir nuget\build\native\include\
115
- copy /Y libmaxminddb \include\*.h nuget\build\native\include\
117
+ copy /Y ${{ env.MAXMIND_FNAME }} \include\*.h nuget\build\native\include\
116
118
117
119
mkdir nuget\build\native\lib\x64\Debug
118
- copy /Y libmaxminddb \build-x64\Debug\maxminddb.lib nuget\build\native\lib\x64\Debug\
119
- copy /Y libmaxminddb \build-x64\Debug\maxminddb.pdb nuget\build\native\lib\x64\Debug\
120
+ copy /Y ${{ env.MAXMIND_FNAME }} \build-x64\Debug\maxminddb.lib nuget\build\native\lib\x64\Debug\
121
+ copy /Y ${{ env.MAXMIND_FNAME }} \build-x64\Debug\maxminddb.pdb nuget\build\native\lib\x64\Debug\
120
122
121
123
mkdir nuget\build\native\lib\x64\Release
122
- copy /Y libmaxminddb \build-x64\Release\maxminddb.lib nuget\build\native\lib\x64\Release\
124
+ copy /Y ${{ env.MAXMIND_FNAME }} \build-x64\Release\maxminddb.lib nuget\build\native\lib\x64\Release\
123
125
124
126
mkdir nuget\build\native\lib\Win32\Debug
125
- copy /Y libmaxminddb \build-x86\Debug\maxminddb.lib nuget\build\native\lib\Win32\Debug\
126
- copy /Y libmaxminddb \build-x86\Debug\maxminddb.pdb nuget\build\native\lib\Win32\Debug\
127
+ copy /Y ${{ env.MAXMIND_FNAME }} \build-x86\Debug\maxminddb.lib nuget\build\native\lib\Win32\Debug\
128
+ copy /Y ${{ env.MAXMIND_FNAME }} \build-x86\Debug\maxminddb.pdb nuget\build\native\lib\Win32\Debug\
127
129
128
130
mkdir nuget\build\native\lib\Win32\Release
129
- copy /Y libmaxminddb\build-x86\Release\maxminddb.lib nuget\build\native\lib\Win32\Release\
130
-
131
- - name : Clean up
132
- run : |
133
- rmdir /S /Q libmaxminddb
131
+ copy /Y ${{ env.MAXMIND_FNAME }}\build-x86\Release\maxminddb.lib nuget\build\native\lib\Win32\Release\
134
132
135
133
# this is an unconventional use of the pre-release version - see README.md
136
134
- name : Make CI Nuget package
137
135
if : ${{ github.event.inputs.publish-package != 'yes' }}
138
136
run : |
139
- nuget pack nuget\StoneSteps.MaxMindDB.Static.nuspec -Suffix "ci.% BUILD_NUMBER% " -Version ${{ env.PKG_VER }}.${{ env.PKG_REV }}
137
+ nuget pack nuget\StoneSteps.MaxMindDB.Static.nuspec -Suffix "ci.${{ env. BUILD_NUMBER }} " -Version ${{ env.PKG_VER }}.${{ env.PKG_REV }}
140
138
141
139
- name : Upload CI Nuget package
142
140
if : ${{ github.event.inputs.publish-package != 'yes' }}
143
- uses : actions/upload-artifact@v2.2.1
141
+ uses : actions/upload-artifact@v3
144
142
with :
145
143
name : MaxMindDB CI Nuget package
146
144
path : StoneSteps.MaxMindDB.Static.${{ env.PKG_VER }}.${{ env.PKG_REV }}-ci.${{ env.BUILD_NUMBER }}.nupkg
0 commit comments