|
1 | | -name: Build and Release Ext4Explorer |
| 1 | +name: Build Verification |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - tags: |
6 | | - - 'v*' # Trigger on tags like v1.0.0, v2.0.1 etc. |
7 | | - workflow_dispatch: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | build: |
11 | 11 | runs-on: windows-latest |
12 | 12 |
|
13 | 13 | env: |
14 | 14 | Configuration: Release |
15 | | - Runtime: win-x64 |
16 | | - ProjectPath: Ext4Explorer/Ext4Explorer.csproj |
17 | | - OutputDir: publish |
| 15 | + ProjectPath: Ext4Explorer.sln |
18 | 16 |
|
19 | 17 | steps: |
20 | | - - name: 📥 Checkout code |
| 18 | + - name: Checkout code |
21 | 19 | uses: actions/checkout@v4 |
22 | 20 |
|
23 | | - - name: 🧰 Setup .NET SDK |
| 21 | + - name: Setup .NET SDK |
24 | 22 | uses: actions/setup-dotnet@v4 |
25 | 23 | with: |
26 | | - dotnet-version: '6.0.x' # or 8.0.x if you're using .NET 8 |
| 24 | + dotnet-version: '6.0.x' # or '8.0.x' as needed |
27 | 25 |
|
28 | | - - name: 🔁 Restore |
| 26 | + - name: Restore dependencies |
29 | 27 | run: dotnet restore $env:ProjectPath |
30 | 28 |
|
31 | | - - name: 🏗️ Build & Publish Self-contained |
32 | | - run: | |
33 | | - dotnet publish $env:ProjectPath ` |
34 | | - --configuration $env:Configuration ` |
35 | | - --runtime $env:Runtime ` |
36 | | - --self-contained true ` |
37 | | - --output $env:OutputDir ` |
38 | | - /p:PublishSingleFile=true ` |
39 | | - /p:IncludeNativeLibrariesForSelfExtract=true ` |
40 | | - /p:EnableCompressionInSingleFile=true |
41 | | -
|
42 | | - - name: 📦 Create ZIP package |
43 | | - run: Compress-Archive -Path "$env:OutputDir\*" -DestinationPath "Ext4Explorer-${{ github.ref_name }}.zip" |
44 | | - |
45 | | - - name: 🚀 Upload ZIP to GitHub Release |
46 | | - uses: softprops/action-gh-release@v2 |
47 | | - with: |
48 | | - tag_name: ${{ github.ref_name }} |
49 | | - name: Release ${{ github.ref_name }} |
50 | | - files: Ext4Explorer-${{ github.ref_name }}.zip |
51 | | - env: |
52 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 29 | + - name: Build solution |
| 30 | + run: dotnet build $env:ProjectPath --configuration $env:Configuration --no-restore |
| 31 | + |
| 32 | + - name: Run tests |
| 33 | + run: dotnet test $env:ProjectPath --configuration $env:Configuration --no-build --verbosity normal |
0 commit comments