-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (47 loc) · 1.54 KB
/
pre-alpha-build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Pre-Alpha Publish CLI
on:
workflow_dispatch:
env:
PROJECT_NAME: NationsConverterCLI
jobs:
build:
runs-on: ubuntu-latest
name: Build
env:
ZIP_SUFFIX: .zip
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Publish
run: dotnet publish Src/${{ env.PROJECT_NAME }}
-c Release
-r win-x64
-o build/${{ env.PROJECT_NAME }}
-p:PublishTrimmed=true
-p:PublishSingleFile=true
-p:EnableCompressionInSingleFile=true
--self-contained
- name: Zip to ${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }}
uses: thedoctor0/zip-release@main
with:
directory: build
path: ${{ env.PROJECT_NAME }}
filename: ../${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }}
- name: Calculate SHA256 (Windows)
run: |
$hash = Get-FileHash -Path '${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }}' -Algorithm SHA256
$hashValue = $hash.Hash.ToLower()
Write-Host $hashValue
$hashValue | Out-File -FilePath "${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }}.hash.txt"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }}
if-no-files-found: error