Skip to content

Commit 4b2ca70

Browse files
committed
Simplify CI workflow
- Remove multi-OS matrix (pure .NET library works everywhere) - Use branch-sha format for preview versions (e.g., 1.0.0-master-abc1234) - Fix pack job by adding restore and build steps - Keep only Ubuntu runner for faster CI
1 parent e39e9cf commit 4b2ca70

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ env:
1414

1515
jobs:
1616
build:
17-
runs-on: ${{ matrix.os }}
18-
strategy:
19-
matrix:
20-
os: [ubuntu-latest, windows-latest, macos-latest]
17+
runs-on: ubuntu-latest
2118

2219
steps:
2320
- uses: actions/checkout@v4
@@ -39,7 +36,6 @@ jobs:
3936
run: dotnet test --no-build --configuration Release --verbosity normal --logger "console;verbosity=detailed" --collect:"XPlat Code Coverage"
4037

4138
- name: Upload coverage to Codecov
42-
if: matrix.os == 'ubuntu-latest'
4339
uses: codecov/codecov-action@v4
4440
with:
4541
file: '**/coverage.cobertura.xml'
@@ -63,12 +59,18 @@ jobs:
6359
- name: Get version
6460
id: version
6561
run: |
66-
VERSION=$(date +%Y.%m.%d)-preview.${{ github.run_number }}
62+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
63+
VERSION=1.0.0-${BRANCH_NAME}-${GITHUB_SHA::7}
6764
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
6865
echo "Version: $VERSION"
6966
70-
- name: Pack
71-
run: dotnet pack --configuration Release /p:Version=${{ steps.version.outputs.VERSION }} --output ${{ env.NUGET_DIRECTORY }}
67+
- name: Restore dependencies
68+
run: dotnet restore
69+
70+
- name: Build and Pack
71+
run: |
72+
dotnet build --configuration Release --no-restore
73+
dotnet pack --configuration Release --no-build /p:Version=${{ steps.version.outputs.VERSION }} --output ${{ env.NUGET_DIRECTORY }}
7274
7375
- name: Upload artifacts
7476
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)