-
Notifications
You must be signed in to change notification settings - Fork 42
49 lines (46 loc) · 1.95 KB
/
dotnet.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
name: .NET Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: xXx_set_env_variables_xXx
run: echo "GIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
include-prerelease: true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release /p:DebugType=None
- name: Rename executables
working-directory: /home/runner/work/Obsidian/Obsidian/Obsidian.ConsoleApp/bin/Release/net8.0/
run: |
mv Obsidian.ConsoleApp.dll ObsidianApp.dll
mv Obsidian.ConsoleApp.deps.json ObsidianApp.deps.json
mv Obsidian.ConsoleApp.runtimeconfig.json ObsidianApp.runtimeconfig.json
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: Obsidian-Nightly-Build
path: /home/runner/work/Obsidian/Obsidian/Obsidian.ConsoleApp/bin/Release/net8.0/
if: ${{ github.event_name == 'push' }} # Only upload artifacts on push, don't upload them for PRs
- name: Discord Webhook Action
uses: tsickert/discord-webhook@v4.0.0
with:
webhook-url: ${{ secrets.BUILD_WEBHOOK }}
embed-title: New Obsidian build available!
embed-description: |
Developer: [`${{ github.actor }}`](https://github.com/${{ github.actor }})
GH Actions Run: [`${{ github.run_id }}`](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) _(Download under "artifacts")_
Commit SHA: [`${{ github.sha }}`](https://github.com/${{github.repository}}/commit/${{github.sha}})
embed-color: 2424876
embed-footer-text: "Obsidian, A C# implementation of the Minecraft server protocol."
if: ${{ github.event_name == 'push' }} # Only publish webhook on push.