Skip to content

Commit

Permalink
Updated template
Browse files Browse the repository at this point in the history
  • Loading branch information
Farshad DASHTI authored and Farshad DASHTI committed Oct 9, 2024
1 parent 2edbaf0 commit 407d40b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
40 changes: 25 additions & 15 deletions .github/workflows/nuget-package-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,37 @@ 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: |
# Convert newlines in the commit message to a placeholder character (e.g., `~`)
SINGLE_LINE_COMMIT=$(git log -1 --pretty=format:"%b" | tr '\n' '~')
# Extracts release-note between (%release-note: and %)
DESCRIPTION=$(echo "$SINGLE_LINE_COMMIT" | grep -oP '(?<=\(%release-note:)(.*?)(?=\s*%\))')
# Retrieve the commit message body
COMMIT_MESSAGE=$(git log -1 --pretty=format:"%b")
# Replace the placeholder character `~` back with newlines
DESCRIPTION=$(echo "$DESCRIPTION" | sed 's/~/\n/g')
if [[ -z "$DESCRIPTION" ]]; then
# Check if the commit message is empty
if [[ -z "$COMMIT_MESSAGE" ]]; then
echo "No commit message found. Skipping release note extraction."
DESCRIPTION="No release notes provided."
else
# Convert newlines in the commit message to a placeholder character (e.g., `~`)
SINGLE_LINE_COMMIT=$(echo "$COMMIT_MESSAGE" | tr '\n' '~')
# Extract release note content from the single-line commit message
DESCRIPTION=$(echo "$SINGLE_LINE_COMMIT" | grep -oP '(?<=\(%release-note:)(.*?)(?=\s*%\))')
# Replace the placeholder character `~` back with newlines
DESCRIPTION=$(echo "$DESCRIPTION" | sed 's/~/\n/g')
# Check if the description extraction found anything
if [[ -z "$DESCRIPTION" ]]; then
DESCRIPTION="No release notes provided."
fi
fi
echo "RELEASE_DESCRIPTION<<EOF" >> $GITHUB_ENV
Expand Down
1 change: 0 additions & 1 deletion src/DfE.CoreLibs.Testing/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dotnet add package DfE.CoreLibs.Testing

## Usage


### Usage of Customization Attributes

In your tests, you can use `CustomAutoData` to easily inject customizations like `AutoMapperCustomization`, this Customization scans your assembly for profiles and registers them automatically.
Expand Down

0 comments on commit 407d40b

Please sign in to comment.