-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (75 loc) · 2.81 KB
/
Copy pathrelease.yml
File metadata and controls
92 lines (75 loc) · 2.81 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
jobs:
release:
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Restore solution
run: dotnet restore PassTheStick.sln
- name: Build solution
run: dotnet build PassTheStick.sln --configuration Release --no-restore
- name: Publish app (unified Host + Guest UI)
run: >
dotnet publish src/PassTheStick.Host/PassTheStick.Host.csproj
-c Release -r win-x64 --self-contained true
-p:PublishSingleFile=true
-p:EnableCompressionInSingleFile=true
-o publish/app
- name: Bundle relay runtime (Node + ws)
run: |
$relayOut = "publish/app/relay"
New-Item -ItemType Directory -Force $relayOut | Out-Null
Copy-Item -Force src/PassTheStick.Relay/server.js $relayOut/
Copy-Item -Force src/PassTheStick.Relay/package.json $relayOut/
Push-Location src/PassTheStick.Relay
npm install --omit=dev
Pop-Location
Copy-Item -Recurse -Force src/PassTheStick.Relay/node_modules $relayOut/
$nodeZip = "node-win-x64.zip"
$nodeUrl = "https://nodejs.org/dist/v22.14.0/node-v22.14.0-win-x64.zip"
Invoke-WebRequest -Uri $nodeUrl -OutFile $nodeZip
Expand-Archive -Path $nodeZip -DestinationPath node-extract -Force
Copy-Item -Force node-extract/node-v22.14.0-win-x64/node.exe $relayOut/node.exe
- name: Package relay
run: |
New-Item -ItemType Directory -Force artifacts | Out-Null
$relayFiles = @(
"src/PassTheStick.Relay/server.js",
"src/PassTheStick.Relay/Dockerfile",
"src/PassTheStick.Relay/fly.toml",
"src/PassTheStick.Relay/package.json"
)
Compress-Archive -Path $relayFiles -DestinationPath artifacts/PassTheStick-relay-selfhost.zip -Force
- name: Build installer
run: |
$tag = "${{ github.ref_name }}"
$ver = $tag.TrimStart('v')
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DAppVersion=$ver installer/setup.iss
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
files: |
output/PassTheStick-Setup-*.exe
artifacts/PassTheStick-relay-selfhost.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}