Skip to content

Commit

Permalink
Configure CI and Release workflows, so that developer-facing progress…
Browse files Browse the repository at this point in the history
… gets published to a developer feed while tagged releases get published to NuGet.
  • Loading branch information
plioi committed Aug 7, 2022
1 parent e3a3899 commit eb966d3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 11 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.202'
- name: Build / Test / Pack
run: pwsh ./eng/pack.ps1
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.302'
- name: Build / Test / Pack
run: pwsh ./eng/pack.ps1
- name: Release to MyGet
env:
PACKAGE_URL: https://www.myget.org/F/parsley-ci/api/v3/index.json
PACKAGE_API_KEY: ${{ secrets.MYGET_API_KEY }}
run: pwsh ./eng/release.ps1
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.302'
- name: Build / Test / Pack
run: pwsh ./eng/pack.ps1
- name: Release to NuGet
env:
PACKAGE_URL: https://api.nuget.org/v3/index.json
PACKAGE_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: pwsh ./eng/release.ps1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/src/**/bin/
/src/**/obj/
/src/**/*.csproj.user
/artifacts/
/BenchmarkDotNet.Artifacts/
6 changes: 6 additions & 0 deletions eng/release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$packages = get-childitem artifacts/*.nupkg | where-object {!$_.Name.EndsWith(".symbols.nupkg")}

foreach ($package in $packages) {
dotnet nuget push $package --source $env:PACKAGE_URL --api-key $env:PACKAGE_API_KEY
if ($lastexitcode -ne 0) { throw $lastexitcode }
}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.202",
"version": "6.0.302",
"rollForward": "feature"
}
}
1 change: 1 addition & 0 deletions src/Parsley.Benchmark/Parsley.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit eb966d3

Please sign in to comment.