Skip to content

release: Reliable.HttpClient v1.0.0 stable #11

release: Reliable.HttpClient v1.0.0 stable

release: Reliable.HttpClient v1.0.0 stable #11

Workflow file for this run

name: Release & Publish
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clean
run: |
dotnet clean Reliable.HttpClient.sln -c Release || true
find src -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} + || true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Extract version
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Pack
run: |
dotnet pack src/Reliable.HttpClient/Reliable.HttpClient.csproj \
-c Release \
-p:ContinuousIntegrationBuild=true \
-p:Version=${{ steps.ver.outputs.version }} \
--no-build
- name: Verify package exists
run: |
compgen -G "src/Reliable.HttpClient/bin/Release/*.nupkg" > /dev/null \
|| (echo "No .nupkg produced" >&2; exit 1)
- name: List packaged artifacts
run: |
echo "Listing packed files:" && ls -la src/Reliable.HttpClient/bin/Release || true
echo "NUPKG:" && ls -1 src/Reliable.HttpClient/bin/Release/*.nupkg || echo "No .nupkg found"
echo "SNUPKG:" && ls -1 src/Reliable.HttpClient/bin/Release/*.snupkg || echo "No .snupkg found"
- name: Archive package
uses: actions/upload-artifact@v4
with:
name: nupkg
path: src/Reliable.HttpClient/bin/Release/*.nupkg
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: src/Reliable.HttpClient/bin/Release/*.nupkg
generate_release_notes: true
- name: Publish to NuGet
run: |
dotnet nuget push src/Reliable.HttpClient/bin/Release/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
- name: Publish symbols to NuGet
run: |
if compgen -G "src/Reliable.HttpClient/bin/Release/*.snupkg" > /dev/null; then
dotnet nuget push src/Reliable.HttpClient/bin/Release/*.snupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
else
echo "No snupkg files found, skipping symbol package push."
fi
- name: Publish to GitHub Packages
run: |
dotnet nuget push src/Reliable.HttpClient/bin/Release/*.nupkg \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/akrisanov/index.json \
--skip-duplicate