Skip to content

Merge branch 'develop' #93

Merge branch 'develop'

Merge branch 'develop' #93

name: Create release from /master
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
container: mcr.microsoft.com/dotnet/sdk:7.0
steps:
- uses: actions/checkout@v3
- name: Run Tests
run: dotnet test src/SoundFingerprinting.Tests/SoundFingerprinting.Tests.csproj -c Release -v n
- name: Slack Failure Notification
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#3278BD'
SLACK_MESSAGE: 'SoundFingerprinting core library build failed on master branch'
SLACK_USERNAME: rtCamp
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Define Variables
run: |
cat src/SoundFingerprinting/SoundFingerprinting.csproj | grep PackageVersion | awk -F">" '{print $2}' | awk -F"<" '{print $1}' > SF_CORE_VERSION
echo "##[set-output name=sf_core_version;]$(cat SF_CORE_VERSION)"
id: define_variables
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.define_variables.outputs.sf_core_version }}
release_name: Release ${{ steps.define_variables.outputs.sf_core_version }}
draft: false
prerelease: false
- name: Slack Success Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#3278BD'
SLACK_MESSAGE: 'SoundFingerprinting v${{ steps.define_variables.outputs.sf_core_version }} core library GitHub release created'
SLACK_USERNAME: rtCamp
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
publish-nuget:
needs: build
runs-on: ubuntu-latest
container: mcr.microsoft.com/dotnet/sdk:7.0
steps:
- uses: actions/checkout@master
- name: Publish to NuGet
uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: src/SoundFingerprinting/SoundFingerprinting.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: false # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} # nuget.org API key
# PACKAGE_NAME: NuGet package name, required when it's different from project name. Defaults to project name
INCLUDE_SYMBOLS: false # do not publish symbols
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#3278BD'
SLACK_MESSAGE: 'SoundFingerprinting has been published to NuGet'
SLACK_USERNAME: rtCamp
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}