|
| 1 | +name: Jhoose Security - CMS13 Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, release/* ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + BUILD_NO: 3.1.0.${{ github.run_number }} |
| 12 | + BUILD_NO_PRE: 3.1.0-rc.${{ github.run_number }} |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v6 |
| 21 | + |
| 22 | + - name: Setup .NET |
| 23 | + uses: actions/setup-dotnet@v5 |
| 24 | + with: |
| 25 | + dotnet-version: | |
| 26 | + 10.0.x |
| 27 | +
|
| 28 | + - name: Configure Source |
| 29 | + working-directory: ./src/Jhoose.Security |
| 30 | + run: dotnet nuget add source https://nuget.pkg.github.com/andrewmarkham/index.json --name "GithubBuild" --store-password-in-clear-text --username andrewmarkham --password ${{ secrets.PACKAGE_TOKEN }} |
| 31 | + |
| 32 | + - name: Use Node.js 22.21.0 |
| 33 | + uses: actions/setup-node@v5 |
| 34 | + with: |
| 35 | + node-version: 22.21.0 |
| 36 | + |
| 37 | + - name: Run node |
| 38 | + working-directory: ./src/Jhoose.Security/src |
| 39 | + run: | |
| 40 | + npm install |
| 41 | + npm run publish |
| 42 | +
|
| 43 | + - name: Build (Production) |
| 44 | + if: github.ref == 'refs/heads/main' |
| 45 | + run: dotnet build --configuration Release -p:Version=${{ env.BUILD_NO }} -p:CMSVersion=CMS13 |
| 46 | + working-directory: ./src/Jhoose.Security |
| 47 | + |
| 48 | + - name: Build (Pre Release) |
| 49 | + if: github.ref != 'refs/heads/main' |
| 50 | + run: dotnet build --configuration PreRelease -p:Version=${{ env.BUILD_NO_PRE }} -p:CMSVersion=CMS13 |
| 51 | + working-directory: ./src/Jhoose.Security |
| 52 | + |
| 53 | + - name: Run Jhoose.Security.Tests |
| 54 | + working-directory: ./src/Tests/Jhoose.Security.Tests |
| 55 | + run: dotnet test Jhoose.Security.Tests.csproj --configuration Release --logger "trx;LogFileName=test_results.trx" |
| 56 | + |
| 57 | + - name: Report tests |
| 58 | + if: always() |
| 59 | + uses: dorny/test-reporter@v3 |
| 60 | + with: |
| 61 | + name: NUnit Tests |
| 62 | + path: './src/**/test_results.trx' |
| 63 | + reporter: dotnet-trx |
| 64 | + |
| 65 | + - name: nuget push |
| 66 | + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release') |
| 67 | + working-directory: ./src/Jhoose.Security |
| 68 | + run: dotnet nuget push "**/Jhoose.Security*.nupkg" -k ${{ env.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/andrewmarkham/index.json --skip-duplicate |
| 69 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments