-
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.86 KB
/
publish.yml
File metadata and controls
63 lines (49 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: build
on:
workflow_dispatch:
push:
branches:
- main
tags:
- '*'
jobs:
build:
runs-on: windows-latest
env:
Dotnet_Version: 8.0.x
Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj
steps:
# Checkout codes
- name: Checkout
uses: actions/checkout@v4
# Install the .NET Core workload
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.Dotnet_Version }}
# Restore dependencies
- name: Restore dependencies
run: dotnet restore ${{ env.Project_Path }}
# Build the project
- name: Build
run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore
# Pack the NuGet package
- name: Create NuGet package
run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs
# # Publish to NuGet.org
# - name: Push to NuGet
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }}
# Get package version
- name: Get Package Version
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
$version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\netstandard2.0\Flow.Launcher.Localization.dll").productversion
echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append
# Publish to GitHub releases
- name: Publish GitHub releases
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
files: "nupkgs\\*.nupkg"
tag_name: "v${{ env.release_version }}"