Skip to content

Commit d33d9bb

Browse files
authored
Merge pull request #58 from giraffe-fsharp/mrtz/nix
Prepare release and bump nix dependencies
2 parents ac1d93c + 1504d51 commit d33d9bb

File tree

17 files changed

+333
-151
lines changed

17 files changed

+333
-151
lines changed

.envrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
use_nix
1+
#!/usr/bin/env bash
2+
# the shebang is ignored, but nice for editors
3+
watch_file npins/sources.json
4+
5+
# Load .env file if it exists
6+
dotenv_if_exists
7+
8+
# Activate development shell
9+
use nix

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ env:
88
# Stop wasting time caching packages
99
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
1010
# Disable sending usage data to Microsoft
11-
DOTNET_CLI_TELEMETRY_OPTOUT: true
11+
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
1212
DOTNET_VERSION: 8.0.301
13+
DOTNET_MULTILEVEL_LOOKUP: '0'
14+
DOTNET_NOLOGO: 'true'
15+
FORCE_COLOR: '1'
16+
NUGET_XMLDOC_MODE: ''
1317

1418
# Kill other jobs when we trigger this workflow by sending new commits
1519
# to the PR.
@@ -18,10 +22,13 @@ concurrency:
1822
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1923
cancel-in-progress: true
2024

25+
permissions:
26+
contents: read
27+
2128
jobs:
2229
fantomas-check:
2330
name: "Format with Fantomas"
24-
runs-on: ubuntu-22.04
31+
runs-on: ubuntu-latest
2532
steps:
2633
- name: Checkout repository
2734
uses: actions/checkout@v4

.github/workflows/publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ env:
1313
# Project name to pack and publish
1414
PROJECT_NAME: Giraffe.OpenApi
1515
DOTNET_VERSION: 8.0.301
16+
DOTNET_MULTILEVEL_LOOKUP: '0'
17+
DOTNET_NOLOGO: 'true'
18+
FORCE_COLOR: '1'
19+
NUGET_XMLDOC_MODE: ''
1620
# GitHub Packages Feed settings
1721
GITHUB_FEED: https://nuget.pkg.github.com/giraffe-fsharp/
1822
GITHUB_USER: dustinmoris
@@ -21,6 +25,9 @@ env:
2125
NUGET_FEED: https://api.nuget.org/v3/index.json
2226
NUGET_KEY: ${{ secrets.NUGET_KEY }}
2327

28+
permissions:
29+
contents: read
30+
2431
jobs:
2532
build:
2633
name: Build the project

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
.direnv
1010
.DS_Store
1111
result
12+
result-*

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Notable changes are recorded here.
22

3+
# Giraffe.OpenApi 0.0.2
4+
5+
## Updates
6+
7+
- Add labeled path parameters - Credits @RJSonnenberg
8+
- Fix issue where using multiple path parameters AND addOpenApiSimple, which requires a tuple for the request type, caused a request body to be required despite all parameters being in path. - Credits @RJSonnenberg
9+
- Update sample project to redirect to Swagger UI upon startup. - Credits @RJSonnenberg
10+
311
# Giraffe.OpenApi 0.0.1
412

513
Initial Version
File renamed without changes.

default.nix

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
{
2-
sources ? import ./deps,
2+
sources ? import ./npins,
33
system ? builtins.currentSystem,
4-
}: let
5-
pname = "GiraffeOpenApi";
4+
pkgs ? import sources.nixpkgs {
5+
inherit system;
6+
config = { };
7+
overlays = [ ];
8+
},
9+
}:
10+
let
11+
pname = "Giraffe.OpenApi";
612
dotnet-sdk = pkgs.dotnet-sdk_8;
713
dotnet-runtime = pkgs.dotnetCorePackages.runtime_8_0;
8-
version = "0.0.1";
9-
dotnetTool = toolName: toolVersion: sha256:
10-
pkgs.stdenvNoCC.mkDerivation rec {
11-
name = toolName;
12-
version = toolVersion;
13-
nativeBuildInputs = [pkgs.makeWrapper];
14-
src = pkgs.fetchNuGet {
15-
pname = name;
16-
version = version;
17-
sha256 = sha256;
18-
installPhase = ''mkdir -p $out/bin && cp -r tools/net8.0/any/* $out/bin'';
19-
};
20-
installPhase = ''
21-
runHook preInstall
22-
mkdir -p "$out/lib"
23-
cp -r ./bin/* "$out/lib"
24-
makeWrapper "${dotnet-runtime}/bin/dotnet" "$out/bin/${name}" --add-flags "$out/lib/${name}.dll"
25-
runHook postInstall
26-
'';
27-
};
28-
shell = pkgs.mkShell {
29-
nativeBuildInputs = [
14+
version = "0.0.2";
15+
shell = pkgs.mkShellNoCC {
16+
buildInputs = [
3017
dotnet-sdk
3118
];
3219

20+
packages = [
21+
pkgs.npins
22+
pkgs.fantomas
23+
pkgs.fsautocomplete
24+
];
25+
3326
DOTNET_ROOT = "${dotnet-sdk}";
3427
};
35-
pkgs = import sources.nixpkgs {
36-
inherit system;
37-
config = {};
38-
overlays = [];
39-
};
40-
in {
28+
in
29+
{
4130
inherit shell;
42-
fantomas = dotnetTool "fantomas" (builtins.fromJSON (builtins.readFile ./.config/dotnet-tools.json)).tools.fantomas.version (builtins.head (builtins.filter (elem: elem.pname == "fantomas") ((import ./deps/deps.nix) {fetchNuGet = x: x;}))).sha256;
43-
default = pkgs.callPackage ./deps/giraffe-openapi.nix {
44-
inherit pname version dotnet-sdk dotnet-runtime pkgs;
31+
32+
default = pkgs.callPackage ./nix/package.nix {
33+
inherit
34+
pname
35+
version
36+
dotnet-sdk
37+
dotnet-runtime
38+
pkgs
39+
;
4540
};
4641
}

deps/default.nix

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

deps/giraffe-openapi.nix

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

deps/sources.json

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

0 commit comments

Comments
 (0)