Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Merge pull request #16 from Standard-Query-Language/renovate/xunit-do… #28

Merge pull request #16 from Standard-Query-Language/renovate/xunit-do…

Merge pull request #16 from Standard-Query-Language/renovate/xunit-do… #28

Workflow file for this run

name: Release on Tags
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
permissions:
contents: write
packages: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.203
- name: Extract tag name
id: tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Update version in csproj files
run: |
# Remove 'v' prefix if present
VERSION="${{ steps.tag.outputs.TAG_NAME }}"
VERSION=${VERSION#v}
# Update version in CSQLY project
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/g" CSQLY/CSQLY.csproj
# Update version in CLI project
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/g" CSQLY.CLI/CSQLY.CLI.csproj || true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build
- name: Pack NuGet packages
run: |
dotnet pack CSQLY/CSQLY.csproj --configuration Release --no-build --output packages
dotnet pack CSQLY.CLI/CSQLY.CLI.csproj --configuration Release --no-build --output packages || true
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.tag.outputs.TAG_NAME }}
draft: false
prerelease: false
files: |
packages/*.nupkg
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.TAG_TOKEN }}
- name: Publish NuGet packages
run: |
for f in ./packages/*.nupkg
do
dotnet nuget push "$f" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
done