Skip to content

Commit 9dc4921

Browse files
authored
Merge pull request #311 from Afterlife-Guide/release/1.3.1.17
Release version 1.3.1.17
2 parents 288a025 + 48a3af7 commit 9dc4921

17 files changed

Lines changed: 144 additions & 93 deletions
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Add HotFix Metadata
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches:
7+
- master
8+
workflow_dispatch:
9+
10+
env:
11+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
13+
jobs:
14+
get-version:
15+
if: startsWith(github.head_ref, 'hotfix/')
16+
uses: ./.github/workflows/step-version.yml
17+
18+
update-metadata:
19+
if: github.event.action == 'opened'
20+
needs: [get-version]
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
24+
with:
25+
ref: ${{ github.head_ref }}
26+
- name: Increment Version
27+
id: increment_version
28+
run: |
29+
echo "patch_version=$(($(cat semver.json | jq -r '.patch')+1))" > $GITHUB_OUTPUT
30+
- name: Store New Version
31+
uses: Afterlife-Guide/SemVer.Action@288a02559813fbd67393b5bd001cd796f1665905
32+
with:
33+
path: semver.json
34+
major-version: ${{ needs.get-version.outputs.major }}
35+
minor-version: ${{ needs.get-version.outputs.minor }}
36+
patch-version: ${{ steps.increment_version.outputs.patch_version }}
37+
build-version: ${{ github.run_number }}
38+
- name: Update changelog
39+
uses: baynezy/ChangeLogger.Action@f714b7a6bcb0610dedb551cdc16a5adc0a775972
40+
with:
41+
tag: ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}
42+
43+
- name: Update docker image tag version in action.yml
44+
run: |
45+
sed -i "s/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:.*/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}'/" action.yml
46+
47+
- name: Commit Changes
48+
run: |
49+
git config --global user.name "GitHub Action Bot"
50+
git config --global user.email "[email protected]"
51+
git add CHANGELOG.md semver.json action.yml
52+
git commit --message "Bump Version to ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}"
53+
54+
- name: Push Version
55+
env:
56+
HEAD_REF: ${{ github.head_ref }}
57+
run: git push origin "$HEAD_REF"

.github/workflows/branch-feature.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Deploy Feature Branch
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
4+
push:
65
branches:
7-
- develop
6+
- feature/**
7+
- copilot/**
88
paths:
99
- 'src/**'
1010
- 'test/**'
@@ -19,7 +19,6 @@ env:
1919

2020
jobs:
2121
get-version:
22-
if: startsWith(github.head_ref, 'feature/') || startsWith(github.head_ref, 'copilot/') || github.head_ref == 'master'
2322
uses: ./.github/workflows/step-version.yml
2423

2524
build:
Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
name: Deploy HotFix Branch
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
4+
push:
65
branches:
7-
- master
6+
- hotfix/**
87
workflow_dispatch:
98

109
env:
1110
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1211

1312
jobs:
1413
get-version:
15-
if: startsWith(github.head_ref, 'hotfix/')
1614
uses: ./.github/workflows/step-version.yml
1715

1816
build:
@@ -21,45 +19,4 @@ jobs:
2119
secrets: inherit
2220
with:
2321
version: ${{ needs.get-version.outputs.version }}
24-
checkout-ref: ${{ github.head_ref }}
25-
26-
update-metadata:
27-
if: github.event.action == 'opened'
28-
needs: [get-version]
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
32-
with:
33-
ref: ${{ github.head_ref }}
34-
- name: Increment Version
35-
id: increment_version
36-
run: |
37-
echo "patch_version=$(($(cat semver.json | jq -r '.patch')+1))" > $GITHUB_OUTPUT
38-
- name: Store New Version
39-
uses: Afterlife-Guide/SemVer.Action@9102e863e95f47d9687e4bdd67efe81f8c0d1baf
40-
with:
41-
path: semver.json
42-
major-version: ${{ needs.get-version.outputs.major }}
43-
minor-version: ${{ needs.get-version.outputs.minor }}
44-
patch-version: ${{ steps.increment_version.outputs.patch_version }}
45-
build-version: ${{ github.run_number }}
46-
- name: Update changelog
47-
uses: baynezy/ChangeLogger.Action@3f2bcbe4fb234cdd1ba608c7384d6379568f43a0
48-
with:
49-
tag: ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}
50-
51-
- name: Update docker image tag version in action.yml
52-
run: |
53-
sed -i "s/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:.*/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}'/" action.yml
54-
55-
- name: Commit Changes
56-
run: |
57-
git config --global user.name "GitHub Action Bot"
58-
git config --global user.email "[email protected]"
59-
git add CHANGELOG.md semver.json action.yml
60-
git commit --message "Bump Version to ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}"
61-
62-
- name: Push Version
63-
env:
64-
HEAD_REF: ${{ github.head_ref }}
65-
run: git push origin "$HEAD_REF"
22+
checkout-ref: ${{ github.head_ref }}

.github/workflows/branch-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
needs: [push-package]
4242
runs-on: ubuntu-latest
4343
steps:
44-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
44+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
4545
- name: Create Pull Request
4646
env:
4747
GH_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}

.github/workflows/branch-release.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
name: Deploy Release Branch
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
4+
push:
65
branches:
7-
- master
8-
- develop
9-
paths:
10-
- 'src/**'
11-
- 'test/**'
12-
- '**.sln'
13-
- '**.cake'
14-
- '.github/workflows/branch-release.yml'
15-
- '.github/workflows/step-*.yml'
6+
- release/**
167
workflow_dispatch:
178

189
env:
1910
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2011

2112
jobs:
2213
get-version:
23-
if: startsWith(github.head_ref, 'release/')
2414
uses: ./.github/workflows/step-version.yml
2515

2616
build:

.github/workflows/completed-feature-workflow.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout repo
17-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
17+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
1818
- name: Extract Issue Number
1919
shell: bash
2020
env:
2121
HEAD_REF: ${{ github.head_ref }}
2222
run: echo "issue=$(echo "$HEAD_REF" | sed 's|[^0-9]||g')" >> $GITHUB_OUTPUT
2323
id: extract_issue
2424
- name: Output Issue Number
25-
run: echo "Issue Number- ${{ steps.extract_issue.outputs.issue }}"
25+
env:
26+
ISSUE_NUMBER: ${{ steps.extract_issue.outputs.issue }}
27+
run: echo "Issue Number- $ISSUE_NUMBER"
2628
- name: Update Labels
27-
run: gh issue edit ${{ steps.extract_issue.outputs.issue }} --add-label "status:next release" --remove-label "status:in progress"
2829
env:
2930
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
ISSUE_NUMBER: ${{ steps.extract_issue.outputs.issue }}
32+
run: gh issue edit $ISSUE_NUMBER --add-label "status:next release" --remove-label "status:in progress"

.github/workflows/draft-new-release.yml

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ jobs:
2222
name: "Draft a new release"
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
25+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
26+
with:
27+
token: ${{ secrets.CREATE_PR_TOKEN }}
28+
fetch-depth: 0
2629
- name: Create release branch
27-
run: git checkout -b release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}
30+
env:
31+
MAJOR_VERSION: ${{ github.event.inputs.major_version }}
32+
MINOR_VERSION: ${{ github.event.inputs.minor_version }}
33+
PATCH_VERSION: ${{ github.event.inputs.patch_version }}
34+
RUN_NUMBER: ${{ github.run_number }}
35+
run: git checkout -b release/$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER
2836

2937
- name: Update Version Number
30-
uses: Afterlife-Guide/SemVer.Action@9102e863e95f47d9687e4bdd67efe81f8c0d1baf
38+
uses: Afterlife-Guide/SemVer.Action@288a02559813fbd67393b5bd001cd796f1665905
3139
with:
3240
path: semver.json
3341
major-version: ${{ github.event.inputs.major_version }}
@@ -36,36 +44,59 @@ jobs:
3644
build-version: ${{ github.run_number }}
3745

3846
- name: Update changelog
39-
uses: baynezy/ChangeLogger.Action@3f2bcbe4fb234cdd1ba608c7384d6379568f43a0
47+
uses: baynezy/ChangeLogger.Action@f714b7a6bcb0610dedb551cdc16a5adc0a775972
4048
with:
4149
tag: ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}
4250

4351
- name: Update docker image tag version in action.yml
52+
env:
53+
MAJOR_VERSION: ${{ github.event.inputs.major_version }}
54+
MINOR_VERSION: ${{ github.event.inputs.minor_version }}
55+
PATCH_VERSION: ${{ github.event.inputs.patch_version }}
56+
RUN_NUMBER: ${{ github.run_number }}
4457
run: |
45-
sed -i "s/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:.*/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}'/" action.yml
58+
sed -i "s/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:.*/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER'/" action.yml
4659
4760
- name: Commit changelog, manifest and action definition files
4861
id: make-commit
62+
env:
63+
MAJOR_VERSION: ${{ github.event.inputs.major_version }}
64+
MINOR_VERSION: ${{ github.event.inputs.minor_version }}
65+
PATCH_VERSION: ${{ github.event.inputs.patch_version }}
66+
RUN_NUMBER: ${{ github.run_number }}
4967
run: |
5068
git config --global user.name "GitHub Action Bot"
5169
git config --global user.email "[email protected]"
5270
git add CHANGELOG.md semver.json action.yml
53-
git commit --message "Prepare release ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}"
71+
git commit --message "Prepare release $MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER"
5472
5573
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
5674
5775
- name: Push new branch
58-
run: git push origin release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}
76+
env:
77+
MAJOR_VERSION: ${{ github.event.inputs.major_version }}
78+
MINOR_VERSION: ${{ github.event.inputs.minor_version }}
79+
PATCH_VERSION: ${{ github.event.inputs.patch_version }}
80+
RUN_NUMBER: ${{ github.run_number }}
81+
run: git push origin release/$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER
5982

6083
- name: Create pull request
6184
env:
6285
GH_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}
86+
ACTOR: ${{ github.actor }}
87+
REPOSITORY: ${{ github.repository }}
88+
RUN_ID: ${{ github.run_id }}
89+
COMMIT_SHA: ${{ steps.make-commit.outputs.commit }}
90+
MAJOR_VERSION: ${{ github.event.inputs.major_version }}
91+
MINOR_VERSION: ${{ github.event.inputs.minor_version }}
92+
PATCH_VERSION: ${{ github.event.inputs.patch_version }}
93+
RUN_NUMBER: ${{ github.run_number }}
6394
run: |
64-
echo -e "Hi @${{ github.actor }}!\n\nThis PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.\nI've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.\n\nMerging this PR will create a GitHub release and upload any assets that are created as part of the release build." > msg.txt
95+
echo -e "Hi @$ACTOR!\n\nThis PR was created in response to a manual trigger of the release workflow here: https://github.com/$REPOSITORY/actions/runs/$RUN_ID.\nI've updated the changelog and bumped the versions in the manifest files in this commit: $COMMIT_SHA.\n\nMerging this PR will create a GitHub release and upload any assets that are created as part of the release build." > msg.txt
6596
6697
export msg=$(cat msg.txt) ; gh pr create \
67-
--head release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} \
98+
--head release/$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER \
6899
--base master \
69-
--title "Release version ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}" \
70-
--reviewer ${{ github.actor }} \
100+
--title "Release version $MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER" \
101+
--reviewer $ACTOR \
71102
--body "$msg"

.github/workflows/in-progress-feature-workflow.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout repo
16-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
16+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
1717
- name: Extract Issue Number
1818
shell: bash
1919
run: echo "issue=$(echo ${GITHUB_REF#refs/heads/} | sed 's|[^0-9]||g')" >> $GITHUB_OUTPUT
2020
id: extract_issue
2121
- name: Output Issue Number
22-
run: echo "Issue Number- ${{ steps.extract_issue.outputs.issue }}"
22+
env:
23+
ISSUE_NUMBER: ${{ steps.extract_issue.outputs.issue }}
24+
run: echo "Issue Number- $ISSUE_NUMBER"
2325
- name: Update Labels
24-
run: gh issue edit ${{ steps.extract_issue.outputs.issue }} --add-label "in progress" --remove-label "to do"
2526
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
ISSUE_NUMBER: ${{ steps.extract_issue.outputs.issue }}
29+
run: gh issue edit $ISSUE_NUMBER --add-label "in progress" --remove-label "to do"

.github/workflows/label-configurer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
17+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
1818
- name: Run Labeler
1919
uses: crazy-max/ghaction-github-labeler@24d110aa46a59976b8a7f35518cb7f14f434c916
2020
with:

.github/workflows/step-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
run: |
1919
echo "Branch: ${{ inputs.checkout-ref }}"
2020
- name: Checkout
21-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
21+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
2222
with:
2323
ref: ${{ inputs.checkout-ref }}
2424
- name: Setup .NET Core
25-
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d
25+
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602
2626
with:
2727
dotnet-version: 10.0.x
2828
- name: Restore

0 commit comments

Comments
 (0)