|
| 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: 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 | + |
| 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 |
0 commit comments