-
-
Notifications
You must be signed in to change notification settings - Fork 20
114 lines (102 loc) · 3.68 KB
/
patch.yml
File metadata and controls
114 lines (102 loc) · 3.68 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Patch
on:
workflow_dispatch:
jobs:
Version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.previoustag.outputs.tag }}
changelog: ${{ steps.changelog.outputs.changelog }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get Previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v2
with:
fallback: 1.0.0
- name: Get changelog
id: changelog
run: |
echo 'changelog<<CHANGELOG_BODY_EOF' >> $GITHUB_OUTPUT
echo "$(curl https://gist.githubusercontent.com/vinaghost/f7ce5204670e8194eea71a3961405c2f/raw/)" >> $GITHUB_OUTPUT
echo 'CHANGELOG_BODY_EOF' >> $GITHUB_OUTPUT
Build:
runs-on: windows-latest
needs: Version
env:
DOTNET_INSTALL_DIR: "D:/tools/dotnet"
DOTNET_ROOT: "D:/tools/dotnet"
NUGET_PACKAGES: "D:/.nuget/packages"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Install dependencies
run: dotnet restore --locked-mode
- name: Publish
run: dotnet publish WPFUI -c Release --no-restore --self-contained -p:PublishSingleFile=true -p:AssemblyVersion=${{needs.version.outputs.version}}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v7
with:
name: TBS-${{needs.version.outputs.version}}
path: WPFUI\bin\Release\net8.0-windows10.0.19041.0\win-x64\publish\
if-no-files-found: error
Release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [Build, Version]
steps:
- name: Download artifact
uses: actions/download-artifact@v8
with:
path: TBS
- name: Archive release
run: |
mv TBS TBS-${{needs.version.outputs.version}} && zip -r TBS-${{needs.version.outputs.version}}.zip TBS-${{needs.version.outputs.version}}
- name: Create release
uses: ncipollo/release-action@v1
with:
name: TBS-${{needs.version.outputs.version}}
tag: ${{needs.version.outputs.version}}
commit: main
artifacts: "TBS-${{needs.version.outputs.version}}.zip"
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Please join our Discord server for more information: [https://discord.gg/mBa4f2K](https://discord.gg/mBa4f2K)
**Changelog**:
${{needs.version.outputs.changelog}}
Discord:
runs-on: ubuntu-latest
needs: [Release, Version]
steps:
- name: Ping @everyone
run: |
curl --header "Content-Type: application/json" --data "{\"content\": \"@everyone\"}" "${{ secrets.DISCORD_BOT }}"
- name: Send to discord server
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_BOT }}
title: New patch
nodetail: true
description: |
Version `TBS-${{needs.version.outputs.version}}`
Click [here](https://github.com/vinaghost/TravianBotSharp/releases/tag/${{needs.version.outputs.version}}) to download!
**Changelog**:
${{needs.version.outputs.changelog}}
Clear:
runs-on: ubuntu-latest
needs: Release
steps:
- name: Delete artifact
uses: geekyeggo/delete-artifact@v6
with:
name: TBS