Skip to content

Commit 425e557

Browse files
committed
2 parents a9a894a + 2378b73 commit 425e557

File tree

4 files changed

+113
-14
lines changed

4 files changed

+113
-14
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
jobs:
5+
build:
6+
name: Build
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [windows-latest, ubuntu-latest, macos-latest]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup .NET Core
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 3.1.201
19+
- name: Install dependencies
20+
run: dotnet tool install --global FlubuCore.GlobalTool --version 5.1.8
21+
- name: Build
22+
working-directory: ./NetCoreOpenSource #Better approach than setting working folder each time is to create .flubu file.
23+
run: flubu Build
24+
- name: Test
25+
working-directory: ./NetCoreOpenSource
26+
run: flubu Run.Tests
27+
- name: Pack
28+
working-directory: ./NetCoreOpenSource
29+
run: flubu Pack

NetCoreOpenSource/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
This is a simple example of a build script with FlubuCore for a .NET Core open source project. Build script can be also used as a template.
44

5-
It covers most common build steps that are needed in an open source project: Fetching build version from a file or using GitVersion, updating projects version, building projects in the solution, running tests, packing and publishing a nuget package. It also covers how to run build script in Appveyor and Travis CI.
5+
It covers most common build steps that are needed in an open source project: Fetching build version from a file or using GitVersion, updating projects version, building projects in the solution, running tests, packing and publishing a nuget package. It also covers how to setup build in Appveyor, Travis CI, Github Actions and Azure devops.
6+
7+
- [Travis configuration file](https://github.com/dotnetcore/FlubuCore.Examples/blob/master/.travis.yml) Travis configuration includes publishing of nuget package.
8+
- [AppVeyor configuration file](https://github.com/dotnetcore/FlubuCore.Examples/blob/master/appveyor.yml)
9+
- [Github Actions configurataion file](https://github.com/dotnetcore/FlubuCore.Examples/blob/master/.github/workflows/build.yml)
10+
- [Azure DevOps configuration file](https://github.com/dotnetcore/FlubuCore.Examples/blob/master/azure-pipelines.yml)
611

712
### Running script locally
813

914
- .net core sdk 2.1 or greater is required
10-
- Install FlubuCore global tool with command: 'dotnet tool install --global FlubuCore.GlobalTool --version 4.2.8'
15+
- Install FlubuCore global tool with command: 'dotnet tool install --global FlubuCore.GlobalTool'
1116
- run 'Flubu Rebuild' in the folder where NetCoreOpenSource.sln is located.
1217

1318
For .net core 2.0 and lower use FlubuCore cli tool instead of FlubuCore global tool.

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,18 @@ These examples will help you to get quickly start with FlubuCore:
1212
* [Deployment script example](https://github.com/flubu-core/examples/blob/master/DeployScriptExample/BuildScript/DeployScript.cs
1313
) - Example shows how to write simple deployment script.
1414

15-
* [Open source library example](https://github.com/dotnetcore/FlubuCore.Examples/blob/master/NetCoreOpenSource/Build/BuildScript.cs) - Example covers versioning, building the project, running tests and publishing nuget package.
15+
* [Open source library example](https://github.com/dotnetcore/FlubuCore.Examples/blob/master/NetCoreOpenSource/Build/BuildScript.cs) - Example covers versioning, building the project, running tests and publishing nuget package. It also covers how to setup your build in Travis, Appveyor, Github actions, Azure devops
16+
17+
### How do I get set up (.net core)? ###
18+
#### .net core csproj ####
19+
* Clone source code.
20+
* Examine build script project in .Netcore.csproj folder especialy buildscript.cs
21+
22+
* In cmd navigate to NetCore_csproj folder
23+
* run dotnet restore buildscript.csproj
24+
* run dotnet flubu to run default build action. run dotnet flubu to see all available targets
25+
* see other examples for diferent flubu use cases.
26+
* see FlubuCore wiki for how to get started with flubu
1627

1728
### How do I get set up (.net 4.6)? ###
1829

@@ -21,21 +32,10 @@ These examples will help you to get quickly start with FlubuCore:
2132

2233
* In cmd run flubu.exe to run default build action. Build (example) will compile code, run unit tests, create iis web appilcation and package example application into zip for deployment.
2334

24-
2535
* run flubu.exe help to see other available build actions.
2636
* see other examples for diferent flubu use cases.
2737
* see FlubuCore wiki for how to get started with flubu
2838

29-
### How do I get set up (.net core)? ###
30-
#### .net core csproj ####
31-
* Clone source code.
32-
* Examine build script project in .Netcore.csproj folder especialy buildscript.cs
33-
34-
* In cmd navigate to NetCore_csproj folder
35-
* run dotnet restore buildscript.csproj
36-
* run dotnet flubu to run default build action. run dotnet flubu to see all available targets
37-
* see other examples for diferent flubu use cases.
38-
* see FlubuCore wiki for how to get started with flubu
3939
#### .net core xproj ####
4040
* Clone source code.
4141
* Examine build script project in .Netcore.xproj folder especialy buildscript.cs

azure-pipelines.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
jobs:
2+
3+
- job: Windows
4+
pool:
5+
vmImage: 'windows-latest'
6+
7+
steps:
8+
9+
- script: dotnet tool install --global FlubuCore.GlobalTool --version 5.1.8
10+
displayName: 'install flubu'
11+
12+
- script: flubu build
13+
displayName: Compile
14+
workingDirectory: NetCoreOpenSource
15+
16+
- script: flubu Run.Tests
17+
displayName: Tests
18+
workingDirectory: NetCoreOpenSource
19+
20+
- script: flubu pack
21+
displayName: Pack
22+
workingDirectory: NetCoreOpenSource
23+
24+
- job: Ubuntu
25+
pool:
26+
vmImage: 'ubuntu-latest'
27+
28+
steps:
29+
30+
- task: DotNetCoreInstaller@1
31+
displayName: install Sdk
32+
inputs:
33+
version: '3.1.100'
34+
35+
- script: dotnet tool install --global FlubuCore.GlobalTool --version 5.1.8
36+
displayName: 'install flubu'
37+
38+
- script: flubu build
39+
displayName: Compile
40+
workingDirectory: NetCoreOpenSource
41+
42+
- script: flubu Run.Tests
43+
displayName: Tests
44+
workingDirectory: NetCoreOpenSource
45+
- job: MacOS
46+
pool:
47+
vmImage: 'macOS-latest'
48+
49+
steps:
50+
51+
- task: DotNetCoreInstaller@1
52+
displayName: install Sdk
53+
inputs:
54+
version: '3.1.100'
55+
56+
- script: dotnet tool install --global FlubuCore.GlobalTool --version 5.1.8
57+
displayName: 'install flubu'
58+
59+
- script: flubu build
60+
displayName: Compile
61+
workingDirectory: NetCoreOpenSource
62+
63+
- script: flubu Run.Tests
64+
displayName: Tests
65+
workingDirectory: NetCoreOpenSource

0 commit comments

Comments
 (0)