Skip to content

Commit

Permalink
release action for github
Browse files Browse the repository at this point in the history
  • Loading branch information
amcguier committed Nov 9, 2021
1 parent 81af528 commit cb85c9f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Upload to nuget

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Pull submodules
run: git submodule update --init --recursive --depth 1
- name: Setup .NET Core SDK $
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore tools
run: dotnet tool restore
- name: Fake Build Script
run: dotnet fake build -t release
env:
NUGET_API_KEY: ${{secrets.NUGET_API_TOKEN}}
VERSION: ${{github.event.release.tag_name}}
18 changes: 15 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.DotNet

let version = Environment.environVarOrDefault "VERSION" "0.0.1"
let nugetKey = Environment.environVarOrDefault "NUGET_API_KEY" ""

let v0 = "src/AuthZedClient.V0/AuthZedClient.V0.csproj"

Expand Down Expand Up @@ -51,7 +53,7 @@ let makePackOptions template (opt : Paket.PaketPackParams) =
{ opt with
ToolType = ToolType.CreateLocalTool ()
TemplateFile = template
Version = "0.0.1"
Version = version
OutputPath = packageDir
LockDependencies = true
}
Expand All @@ -66,6 +68,17 @@ Target.create "PackV1" (fun _ ->
Paket.pack (makePackOptions "src/AuthZedClient.V1/paket.template")
)

let makePushOptions (opt: Paket.PaketPushParams) =
{ opt with
ToolType = ToolType.CreateLocalTool ()
ApiKey = nugetKey
WorkingDir = packageDir
}

Target.create "Release" (fun _ ->
Paket.push makePushOptions
)


Target.create "Pack" ignore
Target.create "Build" ignore
Expand All @@ -79,7 +92,6 @@ Target.create "Build" ignore
"PackV0" ==> "Pack"
"PackV1" ==> "Pack"



"Clean" ==> "Pack" ==> "Release"

Target.runOrDefault "BuildV1"
2 changes: 2 additions & 0 deletions src/AuthZedClient.V0/paket.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
id AuthZedClient.V0
title AuthZedClient.V0
type project
authors Andrew McGuier
description A client library for AuthZed generated from the grpc signatures
licenseExpression Apache-2.0
licenseUrl https://licenses.nuget.org/Apache-2.0
projectUrl https://github.com/amcguier/authzed-dotnet
repositoryUrl https://github.com/amcguier/authzed-dotnet
repositoryBranch main
Expand Down
2 changes: 2 additions & 0 deletions src/AuthZedClient.V1/paket.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
id AuthZedClient.V1
title AuthZedClient.V1
type project
authors Andrew McGuier
description A client library for AuthZed generated from the grpc signatures
licenseExpression Apache-2.0
licenseUrl https://licenses.nuget.org/Apache-2.0
projectUrl https://github.com/amcguier/authzed-dotnet
repositoryUrl https://github.com/amcguier/authzed-dotnet
repositoryBranch main
Expand Down

0 comments on commit cb85c9f

Please sign in to comment.