Skip to content

Commit ae511d6

Browse files
committed
add GitHub workflow
1 parent ad9954c commit ae511d6

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build & Publish
2+
3+
on:
4+
# push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
workflow:
9+
runs-on: windows-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v1
16+
with:
17+
dotnet-version: 7.0.x
18+
19+
- name: Restore dependencies
20+
run: dotnet restore
21+
22+
- name: Build
23+
run: dotnet build --no-restore -c Release
24+
25+
- name: Upload Artifact
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: BrowserTabs
29+
path: Output/Release/
30+
31+
- name: publish to nuget
32+
if: ${{ github.ref == 'refs/heads/main' }}
33+
run: nuget push output\release\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{secrets.publish}}
34+
35+
- name: get version
36+
if: ${{ github.ref == 'refs/heads/main' }}
37+
run: |
38+
$version = [system.diagnostics.fileversioninfo]::getversioninfo("output\release\BrowserTabs.dll").productversion
39+
echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append
40+
41+
- name: publish to github releases
42+
if: ${{ github.ref == 'refs/heads/main' }}
43+
uses: softprops/action-gh-release@v1
44+
with:
45+
files: "output\\release\\*.nupkg"
46+
tag_name: "v${{ env.release_version }}"

0 commit comments

Comments
 (0)