-
-
Notifications
You must be signed in to change notification settings - Fork 31
189 lines (169 loc) · 5.95 KB
/
publish.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Arkangel Dispatch
on:
workflow_dispatch:
inputs:
changelogs:
description: 'changelogs'
required: true
type: string
concurrency:
group: production
cancel-in-progress: true
jobs:
publish:
runs-on: windows-latest
environment: github-publish
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
include-prerelease: true
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Reset Tags
run: git fetch --tags
- name: Clean
run: dotnet clean WFBot.sln --configuration "Linux Release" && dotnet nuget locals all --clear
- name: Restore dependencies
run: dotnet restore
- name: Build
run: ./build-wfbot-ci.bat
env:
OFFICIAL_BUILD: official
- name: Zip Linux Arm Release
uses: DuckSoft/[email protected]
with:
pathSource: ./out/WFBotLinuxArm64S/WFBot
pathTarget: WFBot-linux-arm64.7z
- name: Zip Linux Release
uses: DuckSoft/[email protected]
with:
pathSource: ./out/WFBotLinuxX64S/WFBot
pathTarget: WFBot-linux-x64.7z
- name: Zip Windows Release
uses: DuckSoft/[email protected]
with:
pathSource: ./out/WFBotWindowsS/WFBot.exe
pathTarget: WFBot-win-x86.7z
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- uses: suisei-cn/[email protected]
id: downloadfile1
name: Download Windows Wrapper
with:
url: "https://wfbot.cyan.cafe/api/WFBotWrapper/DownloadWrapperWindows"
target: ./
- uses: suisei-cn/[email protected]
id: downloadfile2
name: Download Linux Arm Wrapper
with:
url: "https://wfbot.cyan.cafe/api/WFBotWrapper/DownloadWrapperLinuxArm64"
target: ./
- uses: suisei-cn/[email protected]
id: downloadfile3
name: Download Linux Wrapper
with:
url: "https://wfbot.cyan.cafe/api/WFBotWrapper/DownloadWrapperLinuxX64"
target: ./
- name: Create a GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: ${{ steps.gitversion.outputs.informationalVersion }}
body: ${{ inputs.changelogs }}
- name: Upload WFBot Linux Arm Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./WFBot-linux-arm64.7z
asset_name: WFBot-linux-arm64.7z
asset_content_type: application/x-7z-compressed
- name: Upload WFBot Linux Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./WFBot-linux-x64.7z
asset_name: WFBot-linux-x64.7z
asset_content_type: application/x-7z-compressed
- name: Upload WFBot Windows Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./WFBot-win-x86.7z
asset_name: WFBot-win-x86.7z
asset_content_type: application/x-7z-compressed
- name: Upload WFBot Linux Arm Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.downloadfile2.outputs.filename }}
asset_name: WFBotWrapper-linux-arm64
asset_content_type: application/octet-stream
- name: Upload WFBot Windows Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.downloadfile1.outputs.filename }}
asset_name: WFBotWrapper-win-x86.exe
asset_content_type: application/octet-stream
- name: Upload WFBot Linux Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.downloadfile3.outputs.filename }}
asset_name: WFBotWrapper-linux-x64
asset_content_type: application/octet-stream
docker-publish:
runs-on: ubuntu-latest
environment: docker-publish
needs: publish
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Use Custom Dockerfile
run: |
rm Dockerfile
cp .github/Dockerfile .
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: trksteam/wfbot:latest
env:
OFFICIAL_BUILD: official