Repository navigation
65 lines (61 loc) · 1.88 KB
/
Copy pathdotnetcore.yml
File metadata and controls
65 lines (61 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 publish /p:DebugType=None /p:DebugSymbols=false --self-contained --configuration Release -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@v4
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 }}