Skip to content

Commit e281155

Browse files
committed
Configure CI
1 parent f14165d commit e281155

2 files changed

Lines changed: 88 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
linux:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Setup .NET Core
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: "6.0.x"
20+
- name: Build with dotnet
21+
run: dotnet build --configuration Release
22+
- name: Test with dotnet
23+
run: dotnet test --configuration Release
24+
windows:
25+
runs-on: windows-latest
26+
steps:
27+
- uses: actions/checkout@v1
28+
- name: Setup .NET Core
29+
uses: actions/setup-dotnet@v1
30+
with:
31+
dotnet-version: "6.0.x"
32+
- name: Build with dotnet
33+
run: dotnet build --configuration Release
34+
- name: Test with dotnet
35+
run: dotnet test --configuration Release

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release to NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
package:
13+
[
14+
Protobuf.System.Text.Json
15+
]
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Setup .NET Core
19+
uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: "6.0.x"
22+
- name: Create NuGet Package
23+
run: dotnet pack -c Release /p:Version=${{ github.event.release.name }} /p:PackageReleaseNotes="See https://github.com/Havret/dotnet-activemq-artemis-client/releases/tag/${{ github.event.release.tag_name }}"
24+
- name: Archive NuGet Package
25+
uses: actions/upload-artifact@v1
26+
with:
27+
name: ${{ matrix.package }}
28+
path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg
29+
- name: Archive NuGet Package With Symbols
30+
uses: actions/upload-artifact@v1
31+
with:
32+
name: ${{ matrix.package }}
33+
path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.snupkg
34+
- name: Publish NuGet Package
35+
run: dotnet nuget push ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json
36+
- name: Upload NuGet Package
37+
uses: actions/upload-release-asset@v1
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
upload_url: ${{ github.event.release.upload_url }}
42+
asset_path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg
43+
asset_name: ${{ matrix.package }}.${{ github.event.release.name }}.nupkg
44+
asset_content_type: application/zip
45+
- name: NuGet Package With Symbols
46+
uses: actions/upload-release-asset@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
upload_url: ${{ github.event.release.upload_url }}
51+
asset_path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.snupkg
52+
asset_name: ${{ matrix.package }}.${{ github.event.release.name }}.snupkg
53+
asset_content_type: application/zip

0 commit comments

Comments
 (0)