Skip to content

Commit

Permalink
Merge pull request #211 from NetDevPack/feat/auto-upgrade-hash
Browse files Browse the repository at this point in the history
Feat/auto upgrade hash
  • Loading branch information
brunobritodev authored Feb 27, 2022
2 parents 177c390 + c838d72 commit 7f80a3d
Show file tree
Hide file tree
Showing 101 changed files with 53,712 additions and 19,049 deletions.
37 changes: 37 additions & 0 deletions .github/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".

# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

# This example catches duplicate Signed-off-by lines.

test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
if ! head -1 "$1" | grep -qE "^(feat|fix|ci|chore|docs|test|style|refactor|chk)(\(.+?\))?: .{1,}$"; then
echo "Aborting commit. Your commit message is invalid. See some examples below:" >&2
echo "feat(logging): added logs for failed signups" >&2
echo "fix(homepage): fixed image gallery" >&2
echo "test(homepage): updated tests" >&2
echo "docs(readme): added new logging table information" >&2
echo "For more information check https://www.conventionalcommits.org/en/v1.0.0/ for more details" >&2
exit 1
fi
if ! head -1 "$1" | grep -qE "^.{1,50}$"; then
echo "Aborting commit. Your commit message is too long." >&2
exit 1
fi
44 changes: 34 additions & 10 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ on:
branches: [ master ]

env:
PACKAGE_MAJOR_VERSION: 5
PACKAGE_MINOR_VERSION: 0
REPOSITORY_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
CURRENT_REPO_URL: https://github.com/${{ github.repository }}

jobs:
build:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup .NET 5
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
Expand All @@ -29,12 +25,40 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x

- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Generate version
run: echo "PACKAGE_VERSION=$PACKAGE_MAJOR_VERSION.$PACKAGE_MINOR_VERSION.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
- name: Test
run: dotnet test

- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 18.0.1
extra_plugins: |
@semantic-release/changelog
@semantic-release/github
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Publish the package to nuget.org
run: dotnet nuget push ./out/*.nupkg --skip-duplicate --no-symbols true -k ${{ secrets.NUGET_AUTH_TOKEN}} -s https://api.nuget.org/v3/index.json
5 changes: 5 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
with:
dotnet-version: 5.0.x

- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
Expand Down
11 changes: 11 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"branches": ["master"],

"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
"@semantic-release/git"
]
}
175 changes: 0 additions & 175 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 7f80a3d

Please sign in to comment.