-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add workflow Post-Integration and Release
- Loading branch information
1 parent
5d6af5d
commit 6df9db3
Showing
3 changed files
with
141 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: "Post-Integration" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- '!stable' | ||
- '!release' | ||
|
||
env: | ||
ATC_EMAIL: 'atcnet.org@gmail.com' | ||
ATC_NAME: 'Atc-Net' | ||
NUGET_REPO_URL: 'https://nuget.pkg.github.com/atc-net/index.json' | ||
|
||
jobs: | ||
merge-to-stable: | ||
runs-on: windows-latest | ||
steps: | ||
- name: 🛒 Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT_WORKFLOWS }} | ||
|
||
- name: ⚛️ Sets environment variables - branch-name | ||
uses: nelonoel/branch-name@v1.0.1 | ||
|
||
- name: ⚛️ Sets environment variables - Nerdbank.GitVersioning | ||
uses: dotnet/nbgv@master | ||
with: | ||
setAllVars: true | ||
|
||
- name: ⚙️ Setup dotnet 7.0.x | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '7.0.x' | ||
|
||
- name: ⚙️ Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.11 | ||
|
||
- name: 📐 Ensure nuget.org added as package source on Windows | ||
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config | ||
continue-on-error: true | ||
|
||
- name: 🔁 Restore packages | ||
run: dotnet restore Atc.Installer-WithoutSetup.sln | ||
|
||
- name: 🛠️ Build | ||
run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true | ||
|
||
- name: 🧪 Run unit tests | ||
run: dotnet test Atc.Installer-WithoutSetup.sln -c Release --no-build --filter "Category!=Integration" | ||
|
||
- name: 🌩️ SonarCloud install scanner | ||
run: dotnet tool install --global dotnet-sonarscanner | ||
|
||
- name: 🌩️ SonarCloud analyze | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
shell: pwsh | ||
run: | | ||
dotnet sonarscanner begin /k:"atc-wpf" /o:"atc-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" | ||
dotnet build Atc.Installer-WithoutSetup.sln -c Release /p:UseSourceLink=true --no-restore | ||
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" | ||
- name: ⏩ Merge to stable-branch | ||
run: | | ||
git config --local user.email ${{ env.ATC_EMAIL }} | ||
git config --local user.name ${{ env.ATC_NAME }} | ||
git checkout stable | ||
git merge --ff-only main | ||
git push origin stable | ||
- name: 🗳️ Creating library package for pre-release | ||
run: dotnet pack Atc.Installer-WithoutSetup.sln -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: "Release" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# on: | ||
# workflow_dispatch: | ||
|
||
env: | ||
ATC_EMAIL: 'atcnet.org@gmail.com' | ||
ATC_NAME: 'Atc-Net' | ||
NUGET_REPO_URL: 'https://api.nuget.org/v3/index.json' | ||
|
||
jobs: | ||
release: | ||
if: github.ref == 'refs/heads/stable' | ||
runs-on: windows-latest | ||
steps: | ||
- name: 🛒 Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT_WORKFLOWS }} | ||
|
||
- name: ⚛️ Sets environment variables - branch-name | ||
uses: nelonoel/branch-name@v1.0.1 | ||
|
||
- name: ⚛️ Sets environment variables - Nerdbank.GitVersioning | ||
uses: dotnet/nbgv@master | ||
with: | ||
setAllVars: true | ||
|
||
- name: ⚙️ Setup dotnet 7.0.x | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '7.0.x' | ||
|
||
- name: 📐 Ensure nuget.org added as package source on Windows | ||
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config | ||
continue-on-error: true | ||
|
||
- name: 🔁 Restore packages | ||
run: dotnet restore Atc.Installer-WithoutSetup.sln | ||
|
||
- name: 🛠️ Building library in release mode | ||
run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true | ||
|
||
- name: ⏩ Merge to release-branch | ||
run: | | ||
git config --local user.email ${{ env.ATC_EMAIL }} | ||
git config --local user.name ${{ env.ATC_NAME }} | ||
git checkout release | ||
git merge --ff-only stable | ||
git push origin release | ||
- name: 🗳️ Creating library package for release | ||
run: dotnet pack Atc.Installer-WithoutSetup.sln -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME /p:PublicRelease=true |