build fixes #274
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
name: Jhoose Security | |
on: | |
push: | |
branches: [ main, release/* ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
BUILD_NO: 2.3.0.${{ github.run_number }} | |
BUILD_NO_PRE: 2.3.0-rc.${{ github.run_number }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Setup .NET | |
uses: actions/[email protected] | |
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/[email protected] | |
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 }} |