|
1 | | -name: Build Package |
2 | | - |
3 | | -on: push |
4 | | - |
5 | | -defaults: |
6 | | - run: |
7 | | - working-directory: src |
8 | | - |
9 | | -jobs: |
10 | | - build: |
11 | | - runs-on: ${{ matrix.os }} |
12 | | - env: |
13 | | - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true |
14 | | - strategy: |
15 | | - fail-fast: false |
16 | | - matrix: |
17 | | - os: [ubuntu-latest, windows-latest] |
18 | | - include: |
19 | | - - os: ubuntu-latest |
20 | | - test-framework-command: --framework net10.0 |
21 | | - |
22 | | - steps: |
23 | | - - name: Code Checkout |
24 | | - uses: actions/checkout@v7 |
25 | | - |
26 | | - - name: Install DotNet |
27 | | - uses: actions/setup-dotnet@v5 |
28 | | - with: |
29 | | - dotnet-version: "10.0.x" |
30 | | - |
31 | | - - name: Restore Dependencies |
32 | | - run: dotnet restore |
33 | | - |
34 | | - - name: Build Package |
35 | | - run: dotnet build --no-restore -c Release |
36 | | - |
37 | | - - name: Perform Unit Testing |
38 | | - run: dotnet test --no-build -c Release ${{ matrix.test-framework-command }} --verbosity normal --filter "TestCategory!=Benchmark" |
39 | | - |
40 | | - - name: Create Package |
41 | | - run: dotnet pack Simplify.Web/Simplify.Web.csproj --no-build -c Release -o ./publish |
42 | | - |
43 | | - - name: Create packages artifact |
44 | | - if: ${{ matrix.os == 'windows-latest' }} |
45 | | - uses: actions/upload-artifact@v7 |
46 | | - with: |
47 | | - name: Packages |
48 | | - path: ./src/publish/ |
| 1 | +name: Build Package |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +defaults: |
| 8 | + run: |
| 9 | + working-directory: src |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + os: [ubuntu-latest, windows-latest] |
| 18 | + include: |
| 19 | + - os: ubuntu-latest |
| 20 | + test-framework-command: --framework net10.0 |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v7 |
| 24 | + |
| 25 | + - name: Install DotNet |
| 26 | + uses: actions/setup-dotnet@v5 |
| 27 | + with: |
| 28 | + dotnet-version: "10.0.x" |
| 29 | + |
| 30 | + - name: Restore Dependencies |
| 31 | + run: dotnet restore |
| 32 | + |
| 33 | + - name: Build Package |
| 34 | + run: dotnet build --no-restore -c Release |
| 35 | + |
| 36 | + - name: Perform Unit Testing |
| 37 | + run: dotnet test --no-build -c Release ${{ matrix.test-framework-command }} --verbosity normal --filter "TestCategory!=Benchmark" |
| 38 | + |
| 39 | + - name: Create Package |
| 40 | + run: dotnet pack Simplify.Web/Simplify.Web.csproj --no-build -c Release -o ./publish |
| 41 | + |
| 42 | + - name: Upload packages |
| 43 | + if: ${{ matrix.os == 'windows-latest' }} |
| 44 | + uses: actions/upload-artifact@v7 |
| 45 | + with: |
| 46 | + name: Packages |
| 47 | + path: ./src/publish/ |
| 48 | + |
| 49 | + release: |
| 50 | + if: startsWith(github.ref, 'refs/tags/') |
| 51 | + needs: build |
| 52 | + permissions: |
| 53 | + contents: write |
| 54 | + runs-on: ubuntu-latest |
| 55 | + |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v7 |
| 58 | + |
| 59 | + - name: Download packages |
| 60 | + uses: actions/download-artifact@v7 |
| 61 | + with: |
| 62 | + name: Packages |
| 63 | + path: packages |
| 64 | + |
| 65 | + - name: Extract changelog entry |
| 66 | + run: | |
| 67 | + awk '/^## \[/{if(f) exit; f=1; next} f' \ |
| 68 | + src/Simplify.Web/CHANGELOG.md \ |
| 69 | + > /tmp/release_notes.md |
| 70 | +
|
| 71 | + - name: Create release |
| 72 | + env: |
| 73 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 74 | + run: | |
| 75 | + gh release create "${{ github.ref_name }}" \ |
| 76 | + --title "${{ github.ref_name }}" \ |
| 77 | + --notes-file /tmp/release_notes.md \ |
| 78 | + packages/*.nupkg |
0 commit comments