Skip to content

Commit be8299a

Browse files
Antony BaileyAntony Bailey
authored andcommitted
workflows
1 parent 4d8b64b commit be8299a

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

.github/workflows/release-tags.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release on Tags
33
on:
44
push:
55
tags:
6-
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
77

88
permissions:
99
contents: write
@@ -18,30 +18,40 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Set up Python
22-
uses: actions/setup-python@v5
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
2323
with:
24-
python-version: 3.x
25-
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install setuptools wheel twine
24+
dotnet-version: 9.0.201
3025

3126
- name: Extract tag name
3227
id: tag
3328
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
3429

35-
- name: Update version in setup.py
30+
- name: Update version in csproj files
3631
run: |
3732
# Remove 'v' prefix if present
3833
VERSION="${{ steps.tag.outputs.TAG_NAME }}"
3934
VERSION=${VERSION#v}
40-
sed -i "s/version=['\"][^'\"]*['\"]/version='$VERSION'/g" setup.py
4135
42-
- name: Build and package
36+
# Update version in CSQLY project
37+
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/g" CSQLY/CSQLY.csproj
38+
39+
# Update version in CLI project
40+
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/g" CSQLY.CLI/CSQLY.CLI.csproj || true
41+
42+
- name: Restore dependencies
43+
run: dotnet restore
44+
45+
- name: Build
46+
run: dotnet build --configuration Release --no-restore
47+
48+
- name: Test
49+
run: dotnet test --configuration Release --no-build
50+
51+
- name: Pack NuGet packages
4352
run: |
44-
python setup.py sdist bdist_wheel
53+
dotnet pack CSQLY/CSQLY.csproj --configuration Release --no-build --output packages
54+
dotnet pack CSQLY.CLI/CSQLY.CLI.csproj --configuration Release --no-build --output packages || true
4555
4656
- name: Create Release
4757
id: create_release
@@ -51,7 +61,7 @@ jobs:
5161
draft: false
5262
prerelease: false
5363
files: |
54-
dist/*
64+
packages/*.nupkg
5565
generate_release_notes: true
5666
env:
5767
GITHUB_TOKEN: ${{ secrets.TAG_TOKEN }}

0 commit comments

Comments
 (0)