Skip to content

Commit c2edbcf

Browse files
committed
bump version 3.8.0
1 parent b5bbb49 commit c2edbcf

9 files changed

Lines changed: 48 additions & 74 deletions

File tree

.github/workflows/build-test-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
RELEASE_VERSION: v3.7.0
11+
RELEASE_VERSION: v3.8.0
1212

1313
# Add workflow-level permissions
1414
permissions:

NpgsqlRest/NpgsqlRest.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3030
<PackageReadmeFile>README.MD</PackageReadmeFile>
3131
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
32-
<Version>3.7.0</Version>
33-
<AssemblyVersion>3.7.0</AssemblyVersion>
34-
<FileVersion>3.7.0</FileVersion>
35-
<PackageVersion>3.7.0</PackageVersion>
32+
<Version>3.8.0</Version>
33+
<AssemblyVersion>3.8.0</AssemblyVersion>
34+
<FileVersion>3.8.0</FileVersion>
35+
<PackageVersion>3.8.0</PackageVersion>
3636
<EnableRequestDelegateGenerator>true</EnableRequestDelegateGenerator>
3737
</PropertyGroup>
3838

NpgsqlRestClient/NpgsqlRestClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PublishAot>true</PublishAot>
1111
<PublishTrimmed>true</PublishTrimmed>
1212
<TrimMode>full</TrimMode>
13-
<Version>3.7.0</Version>
13+
<Version>3.8.0</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

NpgsqlRestClient/appsettings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
3.7.0 Default Configuration Template
2+
3.8.0 Default Configuration Template
33
*/
44
{
55
//
@@ -1167,7 +1167,7 @@
11671167
//
11681168
"ForwardedHeaders": {
11691169
//
1170-
// Enable forwarded headers middleware. Must be placed FIRST in the middleware pipeline.
1170+
// Enable forwarded headers middleware (automatically placed first in the middleware pipeline).
11711171
//
11721172
"Enabled": false,
11731173
//
@@ -1308,6 +1308,7 @@
13081308
// Output format for stats endpoints: "json" or "html".
13091309
// - json: JSON array
13101310
// - html: HTML table, Excel-compatible for direct browser copy-paste (default)
1311+
// Can be overridden per-request with the ?format= query string parameter (e.g. ?format=json).
13111312
//
13121313
"OutputFormat": "html",
13131314
//

docker/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Your REST API is now live at `http://localhost:8080`
3131
| `latest-jit` | .NET 10 JIT runtime | ~250 MB |
3232
| `latest-bun` | AOT executable + Bun runtime | ~120 MB |
3333

34-
Version-specific tags are also available (e.g., `3.7.0`, `3.7.0-arm`, `3.7.0-jit`, `3.7.0-bun`).
34+
Version-specific tags are also available (e.g., `3.8.0`, `3.8.0-arm`, `3.8.0-jit`, `3.8.0-bun`).
3535

3636
### Which tag should I use?
3737

npm/config-copy.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

npm/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
"name": "npgsqlrest",
3-
"version": "3.7.0",
3+
"version": "3.8.1",
44
"description": "Automatic REST API for PostgreSQL Databases Client Build",
55
"scripts": {
66
"postinstall": "node postinstall.js",
7-
"uninstall": "node uninstall.js",
8-
"start": "npx npgsqlrest ./appsettings.json ./npgsqlrest.json"
7+
"preuninstall": "node uninstall.js",
8+
"start": "npx npgsqlrest"
99
},
1010
"bin": {
11-
"npgsqlrest": "node_modules/.bin/npgsqlrest",
12-
"npgsqlrest-config-copy": "./config-copy.js"
11+
"npgsqlrest": "./bin/npgsqlrest.js"
1312
},
1413
"repository": {
1514
"type": "git",

npm/postinstall.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ const path = require("path");
55
const os = require("os");
66
const https = require("https");
77

8-
const downloadDir = "../.bin/";
9-
const downloadFrom = "https://github.com/NpgsqlRest/NpgsqlRest/releases/download/v3.7.0/";
8+
const downloadFrom = "https://github.com/NpgsqlRest/NpgsqlRest/releases/download/v3.8.0/";
9+
10+
// Download binary next to this script, not to ../.bin/
11+
const binDir = path.join(__dirname, "bin");
1012

1113
function download(url, to, done) {
1214
https.get(url, (response) => {
@@ -15,13 +17,13 @@ function download(url, to, done) {
1517
response.pipe(file);
1618
file.on("finish", () => {
1719
file.close();
18-
console.info(`${to} ...`,);
20+
console.info(`Downloaded ${path.basename(to)}`);
1921
if (done) {
2022
done();
2123
}
2224
});
2325
} else if (response.statusCode == 302) {
24-
download(response.headers.location, to);
26+
download(response.headers.location, to, done);
2527
} else {
2628
console.error("Error downloading file:", to, response.statusCode, response.statusMessage);
2729
}
@@ -33,36 +35,34 @@ function download(url, to, done) {
3335
}
3436

3537
const osType = os.type();
36-
var downloadFileUrl;
37-
var downloadTo;
38+
const arch = os.arch();
39+
var binaryUrl;
40+
var binaryName;
3841

39-
if (osType === "Windows_NT") {
40-
downloadFileUrl = `${downloadFrom}npgsqlrest-win64.exe`;
41-
downloadTo = `${downloadDir}npgsqlrest.exe`;
42-
} else if (osType === "Linux") {
43-
downloadFileUrl = `${downloadFrom}npgsqlrest-linux64`;
44-
downloadTo = `${downloadDir}npgsqlrest`;
45-
} else if (osType === "Darwin") {
46-
downloadFileUrl = `${downloadFrom}npgsqlrest-osx-arm64`;
47-
downloadTo = `${downloadDir}npgsqlrest`;
42+
if (osType === "Windows_NT" && arch === "x64") {
43+
binaryUrl = `${downloadFrom}npgsqlrest-win64.exe`;
44+
binaryName = "npgsqlrest.exe";
45+
} else if (osType === "Linux" && arch === "x64") {
46+
binaryUrl = `${downloadFrom}npgsqlrest-linux64`;
47+
binaryName = "npgsqlrest";
48+
} else if (osType === "Linux" && arch === "arm64") {
49+
binaryUrl = `${downloadFrom}npgsqlrest-linux-arm64`;
50+
binaryName = "npgsqlrest";
51+
} else if (osType === "Darwin" && arch === "arm64") {
52+
binaryUrl = `${downloadFrom}npgsqlrest-osx-arm64`;
53+
binaryName = "npgsqlrest";
4854
} else {
49-
console.error("Unsupported OS detected:", osType);
55+
console.error(`Unsupported platform: ${osType} ${arch}`);
5056
process.exit(1);
5157
}
5258

53-
if (!fs.existsSync(path.dirname(downloadTo))) {
54-
fs.mkdirSync(path.dirname(downloadTo), { recursive: true });
59+
if (!fs.existsSync(binDir)) {
60+
fs.mkdirSync(binDir, { recursive: true });
5561
}
5662

57-
if (fs.existsSync(downloadTo)) {
58-
fs.unlinkSync(downloadTo);
63+
const binaryPath = path.join(binDir, binaryName);
64+
if (fs.existsSync(binaryPath)) {
65+
fs.unlinkSync(binaryPath);
5966
}
60-
download(downloadFileUrl, downloadTo);
61-
6267

63-
downloadFileUrl = `${downloadFrom}appsettings.json`;
64-
downloadTo = "./appsettings.json";
65-
if (fs.existsSync(downloadFileUrl)) {
66-
fs.unlinkSync(downloadFileUrl, downloadTo);
67-
}
68-
download(downloadFileUrl, downloadTo);
68+
download(binaryUrl, binaryPath);

npm/uninstall.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
#!/usr/bin/env node
22

33
const fs = require("fs");
4+
const path = require("path");
45
const os = require("os");
56

6-
const downloadDir = "../.bin/";
7-
const osType = os.type();
7+
const binDir = path.join(__dirname, "bin");
8+
const ext = os.type() === "Windows_NT" ? ".exe" : "";
9+
const binaryPath = path.join(binDir, `npgsqlrest${ext}`);
810

9-
var downloadTo;
10-
11-
if (osType === "Windows_NT") {
12-
downloadTo = `${downloadDir}npgsqlrest.exe`;
13-
} else {
14-
downloadTo = `${downloadDir}npgsqlrest`;
15-
}
16-
17-
if (fs.existsSync(downloadTo)) {
18-
fs.unlinkSync(downloadTo);
11+
if (fs.existsSync(binaryPath)) {
12+
fs.unlinkSync(binaryPath);
1913
}
20-
21-

0 commit comments

Comments
 (0)