-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (32 loc) · 1.38 KB
/
Copy pathcreaterelease.yml
File metadata and controls
42 lines (32 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Release
on:
release:
types: [published]
jobs:
build:
name: "Release"
env:
ASPNETCORE_ENVIRONMENT: "Production"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Restore Nuget Packages
run: dotnet restore SubscriptionService.sln --source https://api.nuget.org/v3/index.json
- name: Build Code
run: dotnet build SubscriptionService.sln --configuration Release
- name: Run Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "test\SubscriptionService.UnitTests\SubscriptionService.UnitTests.csproj"
dotnet test "test\SubscriptionService.IntegrationTests\SubscriptionService.IntegrationTests.csproj"
- name: Build and Publish Nuget Packages
run: |
dotnet pack "src\SubscriptionService\SubscriptionService.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -p:PackageID=EventStore.SubscriptionService
dotnet nuget push Nugets/EventStore.SubscriptionService.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source nuget.org