Skip to content

Commit a1ee351

Browse files
authored
Merge pull request #47 from MikDal002/30-add-support-for-ubuntu-latest-for-building
👷 ci(workflows): enhance Velopack release pipeline, update GitVersion and improve logging
2 parents dbe69d5 + 5fa1cc1 commit a1ee351

File tree

14 files changed

+82
-117
lines changed

14 files changed

+82
-117
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=crlf
2+
*.sh text eol=lf
3+
*.cmd text eol=lf

.github/workflows/Create_Realease.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/Create_Velopack_Release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,21 @@ jobs:
4242
run: ./build.cmd Tests PublishToGitHubWithVelopack
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
ubuntu-latest:
46+
name: ubuntu-latest
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
.nuke/temp
57+
~/.nuget/packages
58+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
59+
- name: 'Run: Tests, PublishToGitHubWithVelopack'
60+
run: ./build.cmd Tests PublishToGitHubWithVelopack
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/For_each_PR.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,21 @@ jobs:
4242
run: ./build.cmd Tests
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
ubuntu-latest:
46+
name: ubuntu-latest
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
.nuke/temp
57+
~/.nuget/packages
58+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
59+
- name: 'Run: Tests'
60+
run: ./build.cmd Tests
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dotnet.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

GitVersion.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ branches:
1919
# This regex will match any branch name that is NOT 'master' or 'develop'.
2020
# It also implicitly won't match 'release/...' or 'hotfix/...' if you add those
2121
# configurations later, because those more specific regexes would match first.
22-
regex: ^(?!(master|develop|release|hotfix)$).*
23-
label: use-branch-name
22+
regex: ^(?!(master|develop|release|hotfix)$)(?<BranchName>.+)$
23+
label: '{BranchName}'
2424
increment: Inherit
2525
source-branches: [develop, main, master]
2626
track-merge-target: false

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This project uses a GitFlow-inspired branching model, automated with GitVersion.
5151
**Supporting Branches:**
5252

5353
* **`feature/*`** (e.g., `feature/new-user-auth`):
54-
* Branched from `develop` for new development work.
54+
* Typically branched from `develop` for new development work, but can also originate from `main` or `master` if needed.
5555
* Merged back into `develop` upon completion.
5656
* **Versioning (GitVersion):**
5757
* Format: `InheritedBaseVersion-BranchName.Commits` (e.g., `1.1.0-new-user-auth.3` if branched from `develop` at `1.1.0-alpha.x`).

ZtrDotnetTemplates.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elementy rozwiązania", "El
99
ProjectSection(SolutionItems) = preProject
1010
.editorconfig = .editorconfig
1111
Directory.Build.props = Directory.Build.props
12+
global.json = global.json
1213
EndProjectSection
1314
EndProject
1415
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{447A1CBF-6F89-4C07-B4B1-F99C476ADCB2}"

build/Build.Github.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Nuke.Common.CI.GitHubActions;
2+
3+
[GitHubActions("For each PR",
4+
GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, OnPullRequestBranches = new[]
5+
{
6+
DevelopBranch, MainBranch, MasterBranch
7+
},
8+
PublishArtifacts = false,
9+
FetchDepth = 0,
10+
InvokedTargets = new[] { nameof(Tests) },
11+
CacheKeyFiles = new[] { "**/global.json", "**/*.csproj" },
12+
CacheIncludePatterns = new[] { ".nuke/temp", "~/.nuget/packages" },
13+
EnableGitHubToken = true
14+
)]
15+
16+
public partial class Build
17+
{
18+
}

build/Build.Velopack.PublishToGitHub.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[GitHubActions(
77
"Create Velopack Release",
8-
GitHubActionsImage.WindowsLatest,
8+
GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest,
99
OnPushBranches = new[] { MasterBranch, MainBranch, DevelopBranch },
1010
PublishArtifacts = true,
1111
FetchDepth = 0,
@@ -64,6 +64,7 @@ partial class Build
6464
$" --repoUrl {GitHubBrowseUrl}" +
6565
$" --token {GitHubToken}" +
6666
$" --publish" +
67+
$" --merge" +
6768
$" --releaseName {releaseName}" +
6869
$" --tag {tag}" +
6970
$" --targetCommitish {GitVersion.Sha}";

0 commit comments

Comments
 (0)