Skip to content

Commit ba1f808

Browse files
authored
Merge pull request #1 from xperiandri/workflows
Workflows
2 parents bcc73a2 + d9776bc commit ba1f808

File tree

9 files changed

+368
-229
lines changed

9 files changed

+368
-229
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: .NET Core
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
build:
11+
12+
runs-on: windows-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Setup .NET Core
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: 2.1.607
21+
22+
- name: Restore NuGet Packages
23+
run: dotnet restore StringBuilderExtensions.sln
24+
25+
- name: Build with dotnet
26+
run: |
27+
DOTNET_CLI_TELEMETRY_OPTOUT=1
28+
msbuild StringBuilderExtensions.sln /p:Configuration=Release
29+
30+
- name: Run Unit Tests
31+
run: |
32+
cd StringBuilderExtensionsTests
33+
dotnet run -c Release --no-build

.github/workflows/publish_ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: publish to MyGet
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
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: Build with dotnet
18+
run: |
19+
sed -i "s|<Version>\(.*\)</Version>|<Version>\1-ci-$GITHUB_RUN_ID</Version>|" StringBuilderExtensions\StringBuilderExtensions.csproj
20+
dotnet pack --nologo --configuration Release -o nuget
21+
- name: MyGet push
22+
run: |
23+
source=https://www.myget.org/F/xperiandri/api/v3/index.json
24+
key=${{secrets.MyGet_Key}}
25+
dotnet nuget push -s $source -k $key nuget/*.nupkg
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 on version change
25+
uses: rohith/publish-nuget@v2
26+
with:
27+
PROJECT_FILE_PATH: StringBuilderExtensions\StringBuilderExtensions.csproj # Relative to repository root
28+
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
29+
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
30+
# TAG_COMMIT: true # Flag to enable / disalge git tagging
31+
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
32+
NUGET_KEY: ${{secrets.NuGet_Key}}

0 commit comments

Comments
 (0)