Skip to content

Commit 6df9db3

Browse files
committed
feat: Add workflow Post-Integration and Release
1 parent 5d6af5d commit 6df9db3

File tree

3 files changed

+141
-9
lines changed

3 files changed

+141
-9
lines changed
+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: "Post-Integration"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '!stable'
8+
- '!release'
9+
10+
env:
11+
ATC_EMAIL: '[email protected]'
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: windows-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+
uses: nelonoel/[email protected]
27+
28+
- name: ⚛️ Sets environment variables - Nerdbank.GitVersioning
29+
uses: dotnet/nbgv@master
30+
with:
31+
setAllVars: true
32+
33+
- name: ⚙️ Setup dotnet 7.0.x
34+
uses: actions/setup-dotnet@v1
35+
with:
36+
dotnet-version: '7.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: 📐 Ensure nuget.org added as package source on Windows
44+
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
45+
continue-on-error: true
46+
47+
- name: 🔁 Restore packages
48+
run: dotnet restore Atc.Installer-WithoutSetup.sln
49+
50+
- name: 🛠️ Build
51+
run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true
52+
53+
- name: 🧪 Run unit tests
54+
run: dotnet test Atc.Installer-WithoutSetup.sln -c Release --no-build --filter "Category!=Integration"
55+
56+
- name: 🌩️ SonarCloud install scanner
57+
run: dotnet tool install --global dotnet-sonarscanner
58+
59+
- name: 🌩️ SonarCloud analyze
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
63+
shell: pwsh
64+
run: |
65+
dotnet sonarscanner begin /k:"atc-wpf" /o:"atc-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
66+
dotnet build Atc.Installer-WithoutSetup.sln -c Release /p:UseSourceLink=true --no-restore
67+
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
68+
69+
- name: ⏩ Merge to stable-branch
70+
run: |
71+
git config --local user.email ${{ env.ATC_EMAIL }}
72+
git config --local user.name ${{ env.ATC_NAME }}
73+
git checkout stable
74+
git merge --ff-only main
75+
git push origin stable
76+
77+
- name: 🗳️ Creating library package for pre-release
78+
run: dotnet pack Atc.Installer-WithoutSetup.sln -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME

.github/workflows/pre-integration.yml

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
name: "Pre-Integration"
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
# on:
8-
# pull_request:
9-
# types:
10-
# - opened
11-
# - synchronize
12-
# - reopened
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
139

1410
jobs:
1511
dotnet-build:

.github/workflows/release.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Release"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# on:
8+
# workflow_dispatch:
9+
10+
env:
11+
ATC_EMAIL: '[email protected]'
12+
ATC_NAME: 'Atc-Net'
13+
NUGET_REPO_URL: 'https://api.nuget.org/v3/index.json'
14+
15+
jobs:
16+
release:
17+
if: github.ref == 'refs/heads/stable'
18+
runs-on: windows-latest
19+
steps:
20+
- name: 🛒 Checkout repository
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
token: ${{ secrets.PAT_WORKFLOWS }}
25+
26+
- name: ⚛️ Sets environment variables - branch-name
27+
uses: nelonoel/[email protected]
28+
29+
- name: ⚛️ Sets environment variables - Nerdbank.GitVersioning
30+
uses: dotnet/nbgv@master
31+
with:
32+
setAllVars: true
33+
34+
- name: ⚙️ Setup dotnet 7.0.x
35+
uses: actions/setup-dotnet@v1
36+
with:
37+
dotnet-version: '7.0.x'
38+
39+
- name: 📐 Ensure nuget.org added as package source on Windows
40+
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
41+
continue-on-error: true
42+
43+
- name: 🔁 Restore packages
44+
run: dotnet restore Atc.Installer-WithoutSetup.sln
45+
46+
- name: 🛠️ Building library in release mode
47+
run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true
48+
49+
- name: ⏩ Merge to release-branch
50+
run: |
51+
git config --local user.email ${{ env.ATC_EMAIL }}
52+
git config --local user.name ${{ env.ATC_NAME }}
53+
git checkout release
54+
git merge --ff-only stable
55+
git push origin release
56+
57+
- name: 🗳️ Creating library package for release
58+
run: dotnet pack Atc.Installer-WithoutSetup.sln -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME /p:PublicRelease=true

0 commit comments

Comments
 (0)