Skip to content

Commit

Permalink
ci: new dev versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
phnx47-bot committed Aug 21, 2023
1 parent 51d2651 commit 5ba438e
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand All @@ -32,18 +35,28 @@ jobs:
- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --no-restore -c Release -p:ContinuousIntegrationBuild=true

- name: Run tests
run: dotnet test --no-build -c Release --filter FullyQualifiedName\!~Tests.Integration -p:CollectCoverage=true -e:CoverletOutputFormat=opencover

- name: Publish to Codecov
uses: codecov/codecov-action@v3
- name: Pack Dev artifacts

- name: Set Dev version
if: github.ref == 'refs/heads/main'
run: dotnet pack --no-build -c Release --version-suffix dev-$(date +%s)-${GITHUB_SHA::7}
- name: Pack artifacts
run: echo "VERSION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/')" >> $GITHUB_ENV

- name: Set Release version
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet pack --no-build -c Release
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV

- name: Pack NuGet artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}"

- name: Upload artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 5ba438e

Please sign in to comment.