Merge pull request #11 from thinhnotes/feature/FixSonar #107
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Core | |
on: | |
push: | |
branches: | |
- master | |
- feature/** | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.404 | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Install dotnet tools | |
run: dotnet tool install --global dotnet-sonarscanner | |
- name: Start sonar scaner | |
env: | |
SONAR_SECRET: ${{ secrets.SONAR_TOKEN }} | |
run: dotnet sonarscanner begin /k:"thinhnotes_PluralsightDownload" /d:sonar.host.url="https://sonarcloud.io" /o:"thinhnotes" /d:sonar.login="$SONAR_SECRET" /d:sonar.branch.name="${GITHUB_REF#refs/heads/}" | |
- name: Build | |
run: dotnet build --configuration Release --no-restore -o release | |
- name: End sonar scaner | |
env: | |
SONAR_SECRET: ${{ secrets.SONAR_TOKEN }} | |
run: dotnet sonarscanner end /d:sonar.login="$SONAR_SECRET" | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
filename: 'release.zip' | |
directory: 'release' | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release | |
path: | | |
release/release.zip | |
.releaserc | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download a Build Artifact | |
uses: actions/download-artifact@v2.0.9 | |
with: | |
name: release | |
- uses: actions/setup-node@v2 | |
- name: Install Semantic Releaser | |
run: ls -an && npm install @semantic-release/changelog @semantic-release/git -D | |
- name: Release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |