Skip to content

Commit 7f80a3d

Browse files
Merge pull request #211 from NetDevPack/feat/auto-upgrade-hash
Feat/auto upgrade hash
2 parents 177c390 + c838d72 commit 7f80a3d

File tree

101 files changed

+53712
-19049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+53712
-19049
lines changed

.github/hooks/commit-msg

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
#
3+
# An example hook script to check the commit log message.
4+
# Called by "git commit" with one argument, the name of the file
5+
# that has the commit message. The hook should exit with non-zero
6+
# status after issuing an appropriate message if it wants to stop the
7+
# commit. The hook is allowed to edit the commit message file.
8+
#
9+
# To enable this hook, rename this file to "commit-msg".
10+
11+
# Uncomment the below to add a Signed-off-by line to the message.
12+
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13+
# hook is more suited to it.
14+
#
15+
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16+
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17+
18+
# This example catches duplicate Signed-off-by lines.
19+
20+
test "" = "$(grep '^Signed-off-by: ' "$1" |
21+
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
22+
echo >&2 Duplicate Signed-off-by lines.
23+
exit 1
24+
}
25+
if ! head -1 "$1" | grep -qE "^(feat|fix|ci|chore|docs|test|style|refactor|chk)(\(.+?\))?: .{1,}$"; then
26+
echo "Aborting commit. Your commit message is invalid. See some examples below:" >&2
27+
echo "feat(logging): added logs for failed signups" >&2
28+
echo "fix(homepage): fixed image gallery" >&2
29+
echo "test(homepage): updated tests" >&2
30+
echo "docs(readme): added new logging table information" >&2
31+
echo "For more information check https://www.conventionalcommits.org/en/v1.0.0/ for more details" >&2
32+
exit 1
33+
fi
34+
if ! head -1 "$1" | grep -qE "^.{1,50}$"; then
35+
echo "Aborting commit. Your commit message is too long." >&2
36+
exit 1
37+
fi

.github/workflows/publish-package.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,18 @@ on:
55
branches: [ master ]
66

77
env:
8-
PACKAGE_MAJOR_VERSION: 5
9-
PACKAGE_MINOR_VERSION: 0
8+
REPOSITORY_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
109
CURRENT_REPO_URL: https://github.com/${{ github.repository }}
1110

1211
jobs:
13-
build:
12+
publish:
1413
runs-on: ubuntu-latest
15-
defaults:
16-
run:
17-
working-directory: src
1814

1915
steps:
2016
- name: Checkout repository
2117
uses: actions/checkout@v2
2218

23-
- name: Setup .NET 5
19+
- name: Setup .NET
2420
uses: actions/setup-dotnet@v1
2521
with:
2622
dotnet-version: 5.0.x
@@ -29,12 +25,40 @@ jobs:
2925
uses: actions/setup-dotnet@v1
3026
with:
3127
dotnet-version: 3.1.x
28+
29+
- name: Setup .NET Core 2.1
30+
uses: actions/setup-dotnet@v1
31+
with:
32+
dotnet-version: 2.1.x
33+
34+
- name: Setup .NET 6
35+
uses: actions/setup-dotnet@v1
36+
with:
37+
dotnet-version: 6.0.x
38+
39+
- name: Restore dependencies
40+
run: dotnet restore
41+
42+
- name: Build
43+
run: dotnet build --no-restore
3244

33-
- name: Generate version
34-
run: echo "PACKAGE_VERSION=$PACKAGE_MAJOR_VERSION.$PACKAGE_MINOR_VERSION.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
45+
- name: Test
46+
run: dotnet test
47+
48+
- name: Semantic Release
49+
id: semantic
50+
uses: cycjimmy/semantic-release-action@v2
51+
with:
52+
semantic_version: 18.0.1
53+
extra_plugins: |
54+
@semantic-release/changelog
55+
@semantic-release/github
56+
@semantic-release/git
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3559

3660
- name: Generate Package
37-
run: dotnet pack -c Release -o out -p:PackageVersion=${{env.PACKAGE_VERSION}} -p:RepositoryUrl=${{env.CURRENT_REPO_URL}}
61+
run: dotnet pack -c Release -o out -p:PackageVersion=${{ steps.semantic.outputs.new_release_version }} -p:RepositoryUrl=${{env.CURRENT_REPO_URL}}
3862

3963
- name: Publish the package to nuget.org
4064
run: dotnet nuget push ./out/*.nupkg --skip-duplicate --no-symbols true -k ${{ secrets.NUGET_AUTH_TOKEN}} -s https://api.nuget.org/v3/index.json

.github/workflows/pull-request.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ jobs:
2020
with:
2121
dotnet-version: 5.0.x
2222

23+
- name: Setup .NET 6
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: 6.0.x
27+
2328
- name: Setup .NET Core 3.1
2429
uses: actions/setup-dotnet@v1
2530
with:

.releaserc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"branches": ["master"],
3+
4+
"plugins": [
5+
"@semantic-release/commit-analyzer",
6+
"@semantic-release/release-notes-generator",
7+
"@semantic-release/changelog",
8+
"@semantic-release/github",
9+
"@semantic-release/git"
10+
]
11+
}

CHANGELOG.md

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

0 commit comments

Comments
 (0)