Skip to content

Commit 2a9108e

Browse files
committed
Merge branch 'master' of https://github.com/Sire/SQLServerPing
# Conflicts: # SQLServerPing.csproj
2 parents 0109764 + 6636af9 commit 2a9108e

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags like v1.0.0
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
env:
12+
PROJECT_NAME: SQLServerPing
13+
14+
strategy:
15+
matrix:
16+
rid: [win-x64, osx-x64, linux-x64] # runtime identifiers
17+
18+
name: Build for ${{ matrix.rid }}
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: '6.0.x'
27+
28+
- name: Restore dependencies
29+
run: dotnet restore
30+
31+
- name: Build
32+
run: dotnet build --configuration Release --no-restore
33+
34+
- name: Set release filename
35+
run: |
36+
VERSION=${GITHUB_REF_NAME}
37+
FILENAME="${{ env.PROJECT_NAME }}${VERSION}-${{ matrix.rid }}.zip"
38+
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
39+
40+
- name: Publish self-contained app
41+
run: |
42+
dotnet publish -c Release -r ${{ matrix.rid }} --self-contained true -p:PublishSingleFile=true -o publish/${{ matrix.rid }}
43+
44+
- name: Archive binary
45+
run: |
46+
cd publish/${{ matrix.rid }}
47+
zip -r ../../$FILENAME .
48+
49+
- name: Upload ZIP as artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: ${{ env.FILENAME }}
53+
path: ${{ env.FILENAME }}
54+
55+
release:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Download all artifacts
60+
uses: actions/download-artifact@v4
61+
with:
62+
path: artifacts
63+
64+
- name: Upload to GitHub Release
65+
uses: softprops/action-gh-release@v1
66+
with:
67+
files: artifacts/*.zip
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dotnet.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: 6.0.x
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
- name: Build
26+
run: dotnet build --no-restore
27+
# No tests yet
28+
# - name: Test
29+
# run: dotnet test --no-build --verbosity normal

SQLServerPing.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<PackageReference Include="Spectre.Console.Cli.Extensions.DependencyInjection" Version="0.2.0" />
1616
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
1717
<PackageReference Include="System.Text.Json" Version="6.0.11" />
18+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
1819
</ItemGroup>
1920

2021
</Project>

0 commit comments

Comments
 (0)