Skip to content

Commit

Permalink
Added GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
xperiandri committed Apr 8, 2020
1 parent bcc73a2 commit 80b5692
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: .NET Core

on:
pull_request:
branches:
- master
- develop

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Build with dotnet
run: |
DOTNET_CLI_TELEMETRY_OPTOUT=1
dotnet build --nologo --configuration Release
25 changes: 25 additions & 0 deletions .github/workflows/publish_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: publish to MyGet

on:
push:
branches:
- develop

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Build with dotnet
run: |
sed -i "s|<Version>\(.*\)</Version>|<Version>\1-ci-$GITHUB_RUN_ID</Version>|" StringBuilderExtensions\StringBuilderExtensions.csproj
dotnet pack --nologo --configuration Release -o nuget
- name: MyGet push
run: |
source=https://www.myget.org/F/xperiandri/api/v3/index.json
key=${{secrets.MyGet_Key}}
dotnet nuget push -s $source -k $key nuget/*.nupkg
32 changes: 32 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: publish to NuGet

on:
push:
branches:
- master

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest
# Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest
# - name: Setup dotnet
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 3.1.100

# Publish
- name: publish on version change
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: StringBuilderExtensions\StringBuilderExtensions.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
# TAG_COMMIT: true # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NuGet_Key}}
16 changes: 15 additions & 1 deletion StringBuilderExtensions.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio Version 16
VisualStudioVersion = 16.0.29924.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StringBuilderExtensions", "StringBuilderExtensions\StringBuilderExtensions.csproj", "{01E836D1-40BF-49FA-9EE6-65EBB2F76650}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StringBuilderExtensionsTests", "StringBuilderExtensionsTests\StringBuilderExtensionsTests.csproj", "{054701DF-D8ED-434F-B708-075861F611D2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{407C25AD-A79E-442D-A1EF-8ED289439CC0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{7E7071CA-1460-450E-AFA2-4134C15080CA}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\publish_ci.yml = .github\workflows\publish_ci.yml
.github\workflows\publish_release.yml = .github\workflows\publish_release.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -23,6 +34,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {92E327E4-BB79-41E9-88DE-65B35B27DE11}
EndGlobalSection
GlobalSection(CodealikeProperties) = postSolution
SolutionGuid = 5cf8613c-3894-430a-b76a-6b74315e9732
EndGlobalSection
Expand Down

0 comments on commit 80b5692

Please sign in to comment.