Skip to content

Commit f7b5c70

Browse files
committed
Merge pull request #3 from fsprojects/develop
Release package to NuGet with GitHub Actions
2 parents aa12e87 + 638a6df commit f7b5c70

19 files changed

+166
-121
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: .NET Core
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
- develop
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup .NET Core
17+
uses: actions/setup-dotnet@v1
18+
- name: Build with dotnet
19+
run: |
20+
DOTNET_CLI_TELEMETRY_OPTOUT=1
21+
dotnet build --nologo --configuration Release

.github/workflows/publish_ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: publish to MyGet
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup .NET Core
16+
uses: actions/setup-dotnet@v1
17+
- name: Build with dotnet
18+
run: |
19+
sed -i "s|<Version>\(.*\)</Version>|<Version>\1-ci-$GITHUB_RUN_ID</Version>|" src/FSharp.Collections.Immutable/FSharp.Collections.Immutable.fsproj
20+
dotnet pack --nologo --configuration Release -o nuget
21+
- name: MyGet push
22+
run: |
23+
source=https://www.myget.org/F/fsharp-collections-immutable/api/v3/index.json
24+
key=${{secrets.MyGet_Key}}
25+
dotnet nuget push -s $source -k $key nuget/*.nupkg

.github/workflows/publish_release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: publish to NuGet
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
publish:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
# Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest
17+
# Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest
18+
# - name: Setup dotnet
19+
# uses: actions/setup-dotnet@v1
20+
# with:
21+
# dotnet-version: 3.1.100
22+
23+
# Publish
24+
- name: publish on version change
25+
uses: rohith/publish-nuget@v2
26+
with:
27+
PROJECT_FILE_PATH: src/FSharp.Collections.Immutable/FSharp.Collections.Immutable.fsproj # Relative to repository root
28+
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
29+
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
30+
# TAG_COMMIT: true # Flag to enable / disalge git tagging
31+
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
32+
NUGET_KEY: ${{secrets.NuGet_Key}}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,5 @@ FakesAssemblies/
215215
GeneratedArtifacts/
216216
_Pvt_Extensions/
217217
ModelManifest.xml
218+
.ionide/
219+
.idea/

FSharp.Collections.Immutable.sln

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio Version 16
3+
VisualStudioVersion = 16.0.29021.104
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Collections.Immutable", "src\FSharp.Collections.Immutable\FSharp.Collections.Immutable.fsproj", "{9805E74C-D028-4D05-9256-5C2FDC9B6EA8}"
6+
EndProject
7+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9BE8C74B-E5EF-4A0E-8E77-CDCD967B6E88}"
8+
ProjectSection(SolutionItems) = preProject
9+
.github\workflows\build.yml = .github\workflows\build.yml
10+
.github\workflows\publish_ci.yml = .github\workflows\publish_ci.yml
11+
.github\workflows\publish_release.yml = .github\workflows\publish_release.yml
12+
EndProjectSection
13+
EndProject
14+
Global
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|Any CPU = Debug|Any CPU
17+
Release|Any CPU = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{9805E74C-D028-4D05-9256-5C2FDC9B6EA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{9805E74C-D028-4D05-9256-5C2FDC9B6EA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{9805E74C-D028-4D05-9256-5C2FDC9B6EA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{9805E74C-D028-4D05-9256-5C2FDC9B6EA8}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {5A4E44BA-0D9F-4E81-A35E-83A38C3E43CF}
30+
EndGlobalSection
31+
GlobalSection(CodealikeProperties) = postSolution
32+
SolutionGuid = f92c102d-027e-479b-995c-b971032fea8c
33+
EndGlobalSection
34+
EndGlobal

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# FSharp.Collections.Immutable
2+
3+
F# bindings for System.Collections.Immutable
4+
5+
![.NET Core](https://github.com/fsprojects/FSharp.Collections.Immutable/workflows/.NET%20Core/badge.svg)

Source/FSharp.Collections.Immutable/FSharp.Collections.Immutable.sln

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

Source/FSharp.Collections.Immutable/FSharp.Collections.Immutable/FSharp.Collections.Immutable.fsproj

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

Source/FSharp.Collections.Immutable/FSharp.Collections.Immutable/Script.fsx

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

Source/FSharp.Collections.Immutable/FSharp.Collections.Immutable/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard1.6;netstandard2.0</TargetFrameworks>
5+
<Description>F# bindings for System.Collections.Immutable</Description>
6+
<Copyright>Copyright © XperiAndri 2016</Copyright>
7+
<AssemblyTitle>FSharp.Collections.Immutable</AssemblyTitle>
8+
<Company>XperiAndri</Company>
9+
<ProductName>FSharp.Collections.Immutable</ProductName>
10+
<Version>1.0.0</Version>
11+
<Authors>XperiAndri;EventHelix;vilinski</Authors>
12+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
13+
<PackageId>FSharp.Collections.Immutable</PackageId>
14+
<PackageTags>System;Immutable;Collections;FSharp;F#</PackageTags>
15+
<RepositoryType>git</RepositoryType>
16+
<RepositoryUrl>https://github.com/fsprojects/FSharp.Collections.Immutable/</RepositoryUrl>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<Compile Include="immutable-collection-util.fs" />
21+
<Compile Include="flat-list.fs" />
22+
<Compile Include="stack.fs" />
23+
<Compile Include="immutable-list.fs" />
24+
<Compile Include="queue.fs" />
25+
<Compile Include="indexed-seq.fs" />
26+
<Compile Include="maps.fs" />
27+
<Compile Include="sets.fs" />
28+
</ItemGroup>
29+
30+
<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.6'">
31+
<PackageReference Update="FSharp.Core" Version="4.6.2" />
32+
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
33+
</ItemGroup>
34+
35+
<ItemGroup>
36+
<PackageReference Include="System.Collections.Immutable" Version="1.7.0" />
37+
</ItemGroup>
38+
39+
</Project>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,12 @@ module FlatList =
438438
let head list = item 0 list
439439

440440
let tryItem index list =
441-
if index < length list then Some <| item index list
442-
else None
441+
if index >= length list || index < 0 then None
442+
else Some(list.[index])
443443

444444
let tryHead list = tryItem 0 list
445445

446-
let last list = item (length list - 1) list
446+
let last (list : FlatList<_>) = list.[length list - 1]
447447

448448
let tryLast list = tryItem (length list - 1) list
449449

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ module ImmutableList =
218218

219219
let head list = item 0 list
220220

221-
let last list = item (length list - 1) list
221+
let last (list : IImmutableList<_>) = list.[length list - 1]
222222

223223
let tail list = removeAt 0 list
224224

225225
let tryItem index list =
226-
if index < length list then Some <| item index list
227-
else None
226+
if index >= length list || index < 0 then None
227+
else Some(list.[index])
228228

229229
let tryHead list = tryItem 0 list
230230

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ module IndexedSeq =
77
let item index seq = check seq; seq.[index]
88
let length seq = check seq; seq.Count
99

10-
module ReadOnlyList = IndexedSeq
10+
module ReadOnlyList = IndexedSeq
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module HashMap =
5252

5353
let inline toBuilder map : HashMapBuilder<_,_> = check map; map.ToBuilder()
5454

55-
55+
5656
// consider alternate implementation using range functions
5757
let inline filter predicate map =
5858
let builder = toBuilder map
@@ -71,11 +71,3 @@ type internal SortedMapFactory =
7171
System.Collections.Immutable.ImmutableSortedDictionary
7272
module SortedMap =
7373
let inline empty<'Key, 'Value> = SortedMapFactory.Create<'Key, 'Value>()
74-
75-
76-
77-
78-
79-
80-
81-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ type ISet<'T> = System.Collections.Immutable.IImmutableSet<'T>
55
type SortedSet<'T> = System.Collections.Immutable.ImmutableSortedSet<'T>
66

77
type HashSet<'T> = System.Collections.Immutable.ImmutableHashSet<'T>
8-

0 commit comments

Comments
 (0)