1
+ name : " Post-Integration"
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ - ' !stable'
8
+ - ' !release'
9
+
10
+ env :
11
+
12
+ ATC_NAME : ' Atc-Net'
13
+ NUGET_REPO_URL : ' https://nuget.pkg.github.com/atc-net/index.json'
14
+
15
+ jobs :
16
+ merge-to-stable :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - name : 🛒 Checkout repository
20
+ uses : actions/checkout@v2
21
+ with :
22
+ fetch-depth : 0
23
+ token : ${{ secrets.PAT_WORKFLOWS }}
24
+
25
+ - name : ⚛️ Sets environment variables - branch-name
26
+
27
+
28
+ - name : ⚛️ Sets environment variables - Nerdbank.GitVersioning
29
+ uses : dotnet/nbgv@master
30
+ with :
31
+ setAllVars : true
32
+
33
+ - name : ⚙️ Setup dotnet 5.0.x
34
+ uses : actions/setup-dotnet@v1
35
+ with :
36
+ dotnet-version : ' 5.0.x'
37
+
38
+ - name : ⚙️ Set up JDK 11
39
+ uses : actions/setup-java@v1
40
+ with :
41
+ java-version : 1.11
42
+
43
+ - name : 🧹 Clean
44
+ run : dotnet clean -c Release && dotnet nuget locals all --clear
45
+
46
+ - name : 🔁 Restore packages
47
+ run : dotnet restore
48
+
49
+ - name : 🛠️ Build
50
+ run : dotnet build -c Release --no-restore /p:UseSourceLink=true
51
+
52
+ - name : 🧪 Run unit tests
53
+ run : dotnet test -c Release --no-build
54
+
55
+ - name : 🌩️ SonarCloud install scanner
56
+ run : dotnet tool install --global dotnet-sonarscanner
57
+
58
+ - name : 🌩️ SonarCloud analyze
59
+ env :
60
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
62
+ shell : pwsh
63
+ run : |
64
+ dotnet sonarscanner begin /k:"atc-rest-client" /o:"atc-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
65
+ dotnet build -c Release /p:UseSourceLink=true --no-restore
66
+ dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
67
+
68
+ - name : ⏩ Merge to stable-branch
69
+ run : |
70
+ git config --local user.email ${{ env.ATC_EMAIL }}
71
+ git config --local user.name ${{ env.ATC_NAME }}
72
+ git checkout stable
73
+ git merge --ff-only main
74
+ git push origin stable
75
+
76
+ - name : 🗳️ Creating library package for pre-release
77
+ run : dotnet pack -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME
78
+
79
+ - name : 📦 Push packages to GitHub Package Registry
80
+ run : dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.Cosmos.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate
0 commit comments