-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (48 loc) · 1.84 KB
/
build-jhoose-security.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Jhoose Security
on:
push:
branches: [ main, release/* ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
BUILD_NO: 2.3.2.${{ github.run_number }}
BUILD_NO_PRE: 2.3.2-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 }}