Skip to content

Commit

Permalink
Updated the release note indicator
Browse files Browse the repository at this point in the history
(%release-note:Updated the release note indicator%)
  • Loading branch information
Farshad DASHTI authored and Farshad DASHTI committed Oct 9, 2024
1 parent e9d0944 commit d505b53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/nuget-package-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
PROJECT_NAME=${{ inputs.project_name }} # Add the project name from inputs
# Search the last 10 commits for the version update indicator
COMMIT_HASH=$(git log -n 10 --pretty=format:"%H %s" | grep -P '\(#update '"$PROJECT_NAME"' package version to \d+\.\d+\.\d+\)' | grep -oP '^\w+' | head -n 1)
COMMIT_HASH=$(git log -n 10 --pretty=format:"%H %s" | grep -P '\(%update '"$PROJECT_NAME"' package version to \d+\.\d+\.\d+\)' | grep -oP '^\w+' | head -n 1)
if [[ -n "$COMMIT_HASH" ]]; then
echo "Found commit with version update indicator: $COMMIT_HASH"
Expand All @@ -60,7 +60,7 @@ jobs:
echo "This commit has already been processed for version update in $PROJECT_NAME. Skipping."
else
# Extract the version from the commit message
CUSTOM_VERSION=$(git show -s --format=%s $COMMIT_HASH | grep -oP '\(#update '"$PROJECT_NAME"' package version to \K([0-9]+\.[0-9]+\.[0-9]+)')
CUSTOM_VERSION=$(git show -s --format=%s $COMMIT_HASH | grep -oP '\(%update '"$PROJECT_NAME"' package version to \K([0-9]+\.[0-9]+\.[0-9]+)')
if [[ -n "$CUSTOM_VERSION" ]]; then
echo "Using custom version: $CUSTOM_VERSION"
Expand Down Expand Up @@ -97,19 +97,19 @@ jobs:
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
fi
- name: Build, pack and publish
working-directory: ${{ inputs.project_path }}
run: |
dotnet build -c Release
dotnet pack -c Release -p:PackageVersion=${{ env.NEW_VERSION }} --output .
dotnet nuget push "*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/DFE-Digital/index.json
# - name: Build, pack and publish
# working-directory: ${{ inputs.project_path }}
# run: |
# dotnet build -c Release
# dotnet pack -c Release -p:PackageVersion=${{ env.NEW_VERSION }} --output .
# dotnet nuget push "*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/DFE-Digital/index.json

- name: Get Release Note
id: extract_description
run: |
# Extracts multiline release-note between (#release-note: and #)
DESCRIPTION=$(git log -1 --pretty=format:"%b" | awk '/\(#release-note:/{flag=1; next} /#\)/{flag=0} flag')
# Extracts multiline release-note between (%release-note: and %)
DESCRIPTION=$(git log -1 --pretty=format:"%b" | awk '/\(%release-note: ?/{flag=1; next} / ?%\)/{flag=0} flag')
if [[ -z "$DESCRIPTION" ]]; then
DESCRIPTION="No release notes provided."
fi
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ Versioning and Auto-Publishing
1. Make the necessary changes in your library.
2. Commit your changes with a message like the following:

(#update {Project_Name} package version to {version_number})
(%update {Project_Name} package version to {version_number})

Example:

(#update DfE.CoreLibs.FileService package version to 1.1.0)
(%update DfE.CoreLibs.FileService package version to 1.1.0)


The packaging workflow will then automatically set the version to `1.1.0` and increment the patch part (`1.1.x`) with each further change.
Expand All @@ -114,10 +114,10 @@ Each time a package is published succesfully, a new tag and release is created i

* **Custom Release Note:** To add a Release Note to the release, simply include the following to your commit messages:

(#release-note: {note} #)
(%release-note: {note} %)

Example:

(#release-note: Example Message to be Added in the Release Note #)
(%release-note: Example Message to be Added in the Release Note %)


1 change: 1 addition & 0 deletions src/DfE.CoreLibs.Caching/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dotnet add package DfE.CoreLibs.Caching

## Usage


**Usage in Handlers**

1. **Service Registration:** You use `ICacheService` in your handlers to store and retrieve data from memory to avoid unnecessary processing and database queries. Here's how you register the caching service:
Expand Down

0 comments on commit d505b53

Please sign in to comment.