Skip to content

Release/v2.4.0 (#124) #328

Release/v2.4.0 (#124)

Release/v2.4.0 (#124) #328

name: Jhoose Security
on:
push:
branches: [ main, release/* ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
BUILD_NO: 2.4.0.${{ github.run_number }}
BUILD_NO_PRE: 2.4.0-rc.${{ github.run_number }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Configure Source
working-directory: ./src/Jhoose.Security
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 }}
- name: Use Node.js 20.14.0
uses: actions/setup-node@v4
with:
node-version: 20.14.0
- name: Run node
working-directory: ./src/Jhoose.Security
run: |
npm install
npm run publish
- name: Build (Production)
if: github.ref == 'refs/heads/main'
run: dotnet build --configuration Release -p:Version=${{ env.BUILD_NO }}
working-directory: ./src/Jhoose.Security
- name: Build (Pre Release)
if: github.ref != 'refs/heads/main'
run: dotnet build --configuration PreRelease -p:Version=${{ env.BUILD_NO_PRE }}
working-directory: ./src/Jhoose.Security
- name: Test
working-directory: ./src/Jhoose.Security
run: dotnet test --configuration Release --no-build --verbosity normal
- name: nuget push
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release')
working-directory: ./src/Jhoose.Security
run: dotnet nuget push "**/Jhoose.Security*.nupkg" -k ${{ env.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/andrewmarkham/index.json --skip-duplicate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}