-
-
Notifications
You must be signed in to change notification settings - Fork 43
64 lines (52 loc) · 1.64 KB
/
supporters-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
59
60
61
62
63
64
name: Build grzyClothTool for supporters
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
inputs:
branch:
description: "Branch to run the action on"
required: true
default: "master"
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.400"
- name: Restore dependencies
run: dotnet restore
- name: Clean
run: dotnet clean
- name: Build
run: dotnet build
- name: Publish application
run: |
dotnet publish ./grzyClothTool/grzyClothTool.csproj -c Release -r win-x64 --self-contained false --output ./publish `
-p:PublishSingleFile=true `
-p:PublishReadyToRun=true `
-p:TargetFramework=net8.0-windows
- name: Create Zip
run: |
cd publish
powershell Compress-Archive -Path * -DestinationPath ../grzyClothTool-supporters.zip
- name: Send notification to Discord
env:
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
MESSAGE_TEXT: "✅ Build grzyClothTool succeeded! Here is the build ZIP:"
run: |
$attachment = Resolve-Path -Path "./grzyClothTool-supporters.zip"
$message_text = "${env:MESSAGE_TEXT}"
$payload = @{
content = $message_text
} | ConvertTo-Json -Depth 3
# Use curl to send the request
curl -k -F "payload_json=$payload" -F "file1=@$attachment" $env:WEBHOOK_URL