Skip to content

Commit 604c342

Browse files
committed
Fix release pipline
1 parent 14e9347 commit 604c342

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

.github/workflows/create_release.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ on:
44
push:
55
tags:
66
- 'v*' # Trigger on version tags like v1.0.0
7+
8+
permissions:
9+
contents: write
710

811
jobs:
912
build-and-release:
1013
runs-on: ${{ matrix.os }}
1114
strategy:
1215
matrix:
13-
os: [ubuntu-latest, windows-latest, macos-latest]
16+
os: [ubuntu-latest, windows-latest]
1417
include:
1518
- os: ubuntu-latest
19+
rid: linux-x64
1620
ext: ""
1721
- os: windows-latest
22+
rid: win-x64
1823
ext: ".exe"
19-
- os: macos-latest
20-
ext: ""
2124

2225
steps:
2326
- name: Checkout code
@@ -28,35 +31,27 @@ jobs:
2831
with:
2932
dotnet-version: '9.x'
3033

31-
- name: Restore dependencies
32-
run: dotnet restore
33-
3434
- name: Build the CLI
35-
run: dotnet publish ./CS2CalloutExtractor.Cli/CS2CalloutExtractor.Cli.csproj --configuration Release --runtime ${{ matrix.os }} --self-contained true --output ./artifacts/${{ matrix.os }}
36-
37-
- name: Verify artifact exists
38-
run: |
39-
if [ ! -d "./artifacts/${{ matrix.os }}" ]; then
40-
echo "Error: Artifact directory does not exist."
41-
exit 1
42-
fi
35+
run: dotnet publish ./CS2CalloutExtractor.Cli/CS2CalloutExtractor.Cli.csproj --configuration Release --runtime ${{ matrix.rid }} --self-contained true --output ./artifacts/${{ matrix.os }}
4336

4437
- name: Upload artifact
4538
uses: actions/upload-artifact@v4
4639
with:
4740
name: cli-${{ matrix.os }}
48-
path: ./artifacts/${{ matrix.os }}
41+
path: ./artifacts/${{ matrix.os }}/*${{ matrix.ext }}
4942

5043
create-release:
5144
needs: build-and-release
5245
runs-on: ubuntu-latest
5346
steps:
5447
- name: Download artifacts
5548
uses: actions/download-artifact@v4
49+
with:
50+
path: ./release
5651

5752
- name: Create GitHub Release
5853
uses: softprops/action-gh-release@v1
5954
with:
60-
files: ./artifacts/**/*
55+
files: ./release/**
6156
env:
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CS2CalloutExtractor.Cli/CS2CalloutExtractor.Cli.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<RootNamespace>CS2CalloutExtractor.Cli</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
9+
<PublishSingleFile>true</PublishSingleFile>
910
</PropertyGroup>
1011

1112
<ItemGroup>

0 commit comments

Comments
 (0)