Skip to content

Commit e31acab

Browse files
authored
Merge pull request #85 from hassanhabib/users/cjdutoit/releases-3.0.0.0
RELEASES: v3.0.0.0 - Adding Support For Generic Job Definitions
2 parents 2ead107 + 4813a36 commit e31acab

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

.github/workflows/dotnet.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ env:
1515
IS_RELEASE_CANDIDATE: >-
1616
${{
1717
(
18-
github.event_name == 'pull_request' &&
19-
startsWith(github.event.pull_request.title, 'RELEASES:') &&
18+
github.event_name == 'pull_request' &&
19+
startsWith(github.event.pull_request.title, 'RELEASES:') &&
2020
contains(github.event.pull_request.labels.*.name, 'RELEASES')
2121
)
2222
||
2323
(
24-
github.event_name == 'push' &&
25-
startsWith(github.event.head_commit.message, 'RELEASES:') &&
24+
github.event_name == 'push' &&
25+
startsWith(github.event.head_commit.message, 'RELEASES:') &&
2626
startsWith(github.ref_name, 'RELEASE')
2727
)
2828
}}
@@ -57,15 +57,15 @@ jobs:
5757
5858
contains(github.event.pull_request.labels.*.name, 'RELEASES')
5959
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v3
62+
with:
63+
token: ${{ secrets.PAT_FOR_TAGGING }}
6064
- name: Configure Git
6165
run: >-
6266
git config user.name "GitHub Action"
6367
6468
git config user.email "[email protected]"
65-
- name: Checkout code
66-
uses: actions/checkout@v3
67-
with:
68-
token: ${{ secrets.PAT_FOR_TAGGING }}
6969
- name: Extract Version
7070
run: >-
7171
version_number=$(awk -v RS='' -F'</?Version>' 'NF>1{print $2}' ADotNet/ADotNet.csproj | sed -e 's/^[[:space:]]*//')

ADotNet.Infrastructure.Build/Program.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,14 @@ static void Main(string[] args)
9595
Needs = new string[] { "build" },
9696

9797
If =
98-
"needs.build.result == 'success' &&" + Environment.NewLine
99-
+ "github.event.pull_request.merged &&" + Environment.NewLine
100-
+ "github.event.pull_request.base.ref == 'master' &&" + Environment.NewLine
101-
+ "startsWith(github.event.pull_request.title, 'RELEASES:') &&" + Environment.NewLine
102-
+ "contains(github.event.pull_request.labels.*.name, 'RELEASES')",
98+
$"needs.build.result == 'success' && {Environment.NewLine}"
99+
+ $"github.event.pull_request.merged && {Environment.NewLine}"
100+
+ $"github.event.pull_request.base.ref == 'master' && {Environment.NewLine}"
101+
+ $"startsWith(github.event.pull_request.title, 'RELEASES:') && {Environment.NewLine}"
102+
+ $"contains(github.event.pull_request.labels.*.name, 'RELEASES')",
103103

104104
Steps = new List<GithubTask>
105105
{
106-
new ConfigureGitTask()
107-
{
108-
Name = "Configure Git",
109-
},
110-
111106
new CheckoutTaskV3
112107
{
113108
Name = "Checkout code",
@@ -117,6 +112,11 @@ static void Main(string[] args)
117112
}
118113
},
119114

115+
new ConfigureGitTask()
116+
{
117+
Name = "Configure Git",
118+
},
119+
120120
new ExtractProjectPropertyTask(
121121
projectRelativePath: "ADotNet/ADotNet.csproj",
122122
propertyName: "Version",

ADotNet/Models/Pipelines/GithubPipelines/DotNets/EnvironmentVariables.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public sealed class EnvironmentVariables
1111
public static string IsGitHubReleaseCandidate() =>
1212
"${{\n"
1313
+ " (\n"
14-
+ " github.event_name == 'pull_request' &&\n"
15-
+ " startsWith(github.event.pull_request.title, 'RELEASES:') &&\n"
14+
+ " github.event_name == 'pull_request' && \n"
15+
+ " startsWith(github.event.pull_request.title, 'RELEASES:') && \n"
1616
+ " contains(github.event.pull_request.labels.*.name, 'RELEASES')\n"
1717
+ " )\n"
1818
+ " ||\n"
1919
+ " (\n"
20-
+ " github.event_name == 'push' &&\n"
21-
+ " startsWith(github.event.head_commit.message, 'RELEASES:') &&\n"
20+
+ " github.event_name == 'push' && \n"
21+
+ " startsWith(github.event.head_commit.message, 'RELEASES:') && \n"
2222
+ " startsWith(github.ref_name, 'RELEASE')\n"
2323
+ " )\n"
2424
+ "}}";

ADotNet/Models/Pipelines/GithubPipelines/DotNets/TagJob.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ public TagJob(
3434

3535
Steps = new List<GithubTask>
3636
{
37-
new ConfigureGitTask()
38-
{
39-
Name = "Configure Git",
40-
},
41-
4237
new CheckoutTaskV3
4338
{
4439
Name = "Checkout code",
@@ -48,6 +43,11 @@ public TagJob(
4843
}
4944
},
5045

46+
new ConfigureGitTask()
47+
{
48+
Name = "Configure Git",
49+
},
50+
5151
new ExtractProjectPropertyTask(
5252
projectRelativePath,
5353
propertyName: "Version",

0 commit comments

Comments
 (0)