-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (38 loc) · 1.71 KB
/
publish.yml
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
name: Publish Release
on:
push:
branches: ["release"]
jobs:
build:
runs-on: windows-latest
steps:
- name: Set version number
shell: pwsh
run: |
$versionNumber = "2.0.0"
$versionSuffix = "beta.1"
$infoVersion = "$versionNumber-$versionSuffix"
echo $infoVersion
echo "VERSION_NUMBER=$versionNumber" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "INFO_VERSION=$infoVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Publish for win-x64
run: dotnet publish KaddaOK.AvaloniaApp.Windows/KaddaOK.AvaloniaApp.Windows.csproj /p:VersionPrefix=${{ env.VERSION_NUMBER }} /p:VersionSuffix=${{ env.VERSION_SUFFIX }} /p:Configuration=Release /p:RuntimeIdentifier=win-x64 /p:PublishSingleFile=true /p:PublishDir=${{ github.workspace }}/publish
- name: Zip for win-x64
shell: pwsh
run: Compress-Archive -Path ${{ github.workspace }}/publish/* -DestinationPath KaddaOKTools_win-x64_${{ env.INFO_VERSION }}.zip
- name: Upload win-x64 Artifact
uses: actions/upload-artifact@v4
with:
name: KaddaOKTools_win-x64_${{ env.INFO_VERSION }}
path: KaddaOKTools_win-x64_${{ env.INFO_VERSION }}.zip
- name: Create Release
uses: ncipollo/[email protected]
with:
artifacts: "KaddaOKTools_win-x64_${{ env.INFO_VERSION }}.zip"
tag: ${{ env.INFO_VERSION }}