File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,15 @@ jobs:
42
42
- name : " Build release archive"
43
43
run : " make package"
44
44
45
+ - name : " Read current package version"
46
+ run : echo "PACKAGE_VERSION=$(./bin/update-release-version.php version)" >> "$GITHUB_ENV"
47
+
45
48
- name : " Install release archive to verify correctness"
46
- run : pecl install mongodb-${{ github.ref_name }}.tgz
49
+ run : pecl install mongodb-${{ env.PACKAGE_VERSION }}.tgz
47
50
48
51
- name : " Upload archive"
49
52
uses : actions/upload-artifact@v4
50
53
with :
51
- name : mongodb-${{ github.ref_name }}.tgz
52
- path : mongodb-${{ github.ref_name }}.tgz
54
+ name : mongodb-${{ env.PACKAGE_VERSION }}.tgz
55
+ path : mongodb-${{ env.PACKAGE_VERSION }}.tgz
53
56
retention-days : 3
Original file line number Diff line number Diff line change @@ -12,9 +12,10 @@ function usage()
12
12
{$ argv [0 ]} <command>
13
13
14
14
Commands:
15
- stable: Mark the current version as stable
16
- patch: Update to the next patch development version
17
- minor: Update to the next minor development version
15
+ stable: Mark the current version as stable
16
+ patch: Update to the next patch development version
17
+ minor: Update to the next minor development version
18
+ version: Print the current version number
18
19
19
20
EOT ;
20
21
@@ -31,7 +32,6 @@ function read_release_version(string $filename): array
31
32
32
33
$ versions = [];
33
34
34
- // TODO: Error handling
35
35
if (! preg_match ('/^#define PHP_MONGODB_VERSION "(.*)"$/m ' , $ contents , $ matches )) {
36
36
throw new Exception ('Could not match PHP_MONGODB_VERSION ' );
37
37
}
@@ -147,6 +147,10 @@ function get_next_minor_version(array $versions): array
147
147
$ currentVersion = read_release_version (VERSION_FILENAME );
148
148
149
149
switch ($ argv [1 ] ?? null ) {
150
+ case 'version ' :
151
+ echo $ currentVersion ['version ' ];
152
+ exit (0 );
153
+
150
154
case 'stable ' :
151
155
$ newVersion = get_stable_version ($ currentVersion );
152
156
break ;
You can’t perform that action at this time.
0 commit comments