Skip to content

Commit 04885a3

Browse files
Jurixperiandri
authored andcommitted
Added github workflows for CI and CD with versioning, added a shared icon for all packages
1 parent 61835e4 commit 04885a3

File tree

4 files changed

+91
-1
lines changed

4 files changed

+91
-1
lines changed

.github/workflows/publish_ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: publish to GitHub
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
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: Pack FSharp.Data.GraphQL.Client project
18+
run: |
19+
sed -i "s|<PackageVersion>\(.*\)</PackageVersion>|<PackageVersion>\1-ci-$GITHUB_RUN_ID</PackageVersion>|" Directory.Build.targets
20+
cd src/FSharp.Data.GraphQL.Client
21+
dotnet pack --nologo --configuration Release -o ../../nuget
22+
- name: Pack FSharp.Data.GraphQL.Server project
23+
run: |
24+
cd src/FSharp.Data.GraphQL.Server
25+
dotnet pack --nologo --configuration Release -o ../../nuget
26+
- name: Pack FSharp.Data.GraphQL.Server.Middleware project
27+
run: |
28+
cd src/FSharp.Data.GraphQL.Server.Middleware
29+
dotnet pack --nologo --configuration Release -o ../../nuget
30+
- name: NuGet push
31+
run: |
32+
source=https://nuget.pkg.github.com/fsprojects/index.json
33+
key=${{secrets.GITHUB_TOKEN}}
34+
dotnet nuget push nuget/*.nupkg -s $source -k $key
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 FSharp.Data.GraphQL.Client on version change
25+
uses: rohith/publish-nuget@v2
26+
with:
27+
PROJECT_FILE_PATH: src/FSharp.Data.GraphQL.Client/FSharp.Data.GraphQL.Client.fsproj # Relative to repository root
28+
VERSION_FILE_PATH: Directory.Build.targets
29+
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
30+
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
31+
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
32+
# TAG_COMMIT: true # Flag to enable / disalge git tagging
33+
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
34+
NUGET_KEY: ${{secrets.NUGET_SECRET}}
35+
- name: publish FSharp.Data.GraphQL.Server on version change
36+
uses: rohith/publish-nuget@v2
37+
with:
38+
PROJECT_FILE_PATH: src/FSharp.Data.GraphQL.Server/FSharp.Data.GraphQL.Server.fsproj
39+
VERSION_FILE_PATH: Directory.Build.targets
40+
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
41+
NUGET_KEY: ${{secrets.NUGET_SECRET}}
42+
- name: publish FSharp.Data.GraphQL.Server.Middleware on version change
43+
uses: rohith/publish-nuget@v2
44+
with:
45+
PROJECT_FILE_PATH: src/FSharp.Data.GraphQL.Server.Middleware/FSharp.Data.GraphQL.Server.Middleware.fsproj
46+
VERSION_FILE_PATH: Directory.Build.targets
47+
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
48+
NUGET_KEY: ${{secrets.NUGET_SECRET}}

Directory.Build.targets

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
<Product>FSharp.Data.GraphQL</Product>
1515
<Summary>F# implementation of Facebook GraphQL query language</Summary>
1616

17+
<RepoRoot>$([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('.gitignore', '$(MSBuildThisFileDirectory)'))))</RepoRoot>
18+
<RepositoryUrl>https://github.com/fsprojects/FSharp.Data.GraphQL</RepositoryUrl>
1719
<PackageVersion>1.1.0</PackageVersion>
1820
<PackageTags>FSharp GraphQL Relay React Middleware</PackageTags>
1921
<PackageReadmeFile>README.md</PackageReadmeFile>
20-
<!--<PackageIcon>packageIcon.png</PackageIcon>-->
22+
<PackageIcon>icon.png</PackageIcon>
2123
<!--<PackageIconUrl>https://www.newtonsoft.com/content/images/nugeticon.png</PackageIconUrl>-->
2224
<PackageProjectUrl>https://fsprojects.github.io/FSharp.Data.GraphQL</PackageProjectUrl>
2325
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -28,4 +30,10 @@
2830

2931
<MinVerTagPrefix>v</MinVerTagPrefix>
3032
</PropertyGroup>
33+
34+
<ItemGroup>
35+
<None Include="$(RepoRoot)\icon.png" Pack="true" PackagePath="\"/>
36+
<None Include="$(RepoRoot)\README.md" Pack="true" PackagePath="\"/>
37+
</ItemGroup>
38+
3139
</Project>

icon.png

4.58 KB
Loading

0 commit comments

Comments
 (0)