-
Notifications
You must be signed in to change notification settings - Fork 35
135 lines (113 loc) · 4.74 KB
/
windows.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
name: Windows
on:
push:
branches:
- '**'
tags:
- '**'
# schedule:
# - cron: "0 4 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
CMAKE_BUILD_PRESET: "windows-default"
MMX_VERSION: ${{ github.ref_name }}
MMX_WIN_PACK: "TRUE"
MMX_TELEGRAM_TOKEN: ${{ secrets.MMX_TELEGRAM_TOKEN }}
MMX_TELEGRAM_TO_1: ${{ secrets.MMX_TELEGRAM_TO_1 }}
MMX_TELEGRAM_TO_2: ${{ secrets.MMX_TELEGRAM_TO_2 }}
DISCORD_WEBHOOK: ${{ secrets.MMX_DISCORD_WEBHOOK }}
jobs:
msvc:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: "recursive"
- uses: Jimver/cuda-toolkit@v0.2.21
id: cuda-toolkit
with:
cuda: '12.5.0'
method: 'network'
sub-packages: '["nvcc", "cudart"]'
- run: |
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
nvcc -V
- uses: lukka/get-cmake@latest
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v11
- name: Run CMake consuming CMakePreset.json and vcpkg.json by mean of vcpkg.
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ env.CMAKE_BUILD_PRESET }}
buildPreset: ${{ env.CMAKE_BUILD_PRESET }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: "build"
path: ./build/${{ env.CMAKE_BUILD_PRESET }}/!bin/Release/
- name: Run CPack
run: cpack -C Release --config build/${{ env.CMAKE_BUILD_PRESET }}/CPackConfig.cmake -B build/${{ env.CMAKE_BUILD_PRESET }}/!package
- name: Zip files
run: Get-ChildItem "./build/${{ env.CMAKE_BUILD_PRESET }}/!package" -Filter *.exe | Foreach-Object { 7z a ( (Convert-Path $_.PSParentPath) + "\" + $_.BaseName + ".zip") $_.FullName }
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: "package"
path: ./build/${{ env.CMAKE_BUILD_PRESET }}/!package/*.exe
- name: Upload a Build Artifact to release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/${{ env.CMAKE_BUILD_PRESET }}/!package/*.zip
file_glob: true
tag: ${{ github.ref }}
overwrite: true
notify:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [msvc]
steps:
- name: Get the version
id: get_version
run: echo VERSION=$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT
- name: Telegram notification
if: ${{ env.MMX_TELEGRAM_TO_1 != '' }} && ${{ env.MMX_TELEGRAM_TOKEN != '' }}
uses: appleboy/telegram-action@master
with:
to: ${{ env.MMX_TELEGRAM_TO_1 }}
token: ${{ env.MMX_TELEGRAM_TOKEN }}
format: html
message: |
MMX Node release ${{ steps.get_version.outputs.VERSION }}
${{ github.event.repository.url }}/releases/${{ steps.get_version.outputs.VERSION }}
<a href="https://t.me/mmx_node">Telegram channel</a>
<a href="https://t.me/mmx_node_chat">Telegram chat</a>
<a href="https://t.me/mmx_node_chat_ru">Telegram chat[RU]</a>
<a href="https://discord.gg/tCwevssVmY">Discord</a>
- name: Telegram notification
if: ${{ env.MMX_TELEGRAM_TO_2 != '' }} && ${{ env.MMX_TELEGRAM_TOKEN != '' }}
uses: appleboy/telegram-action@master
with:
to: ${{ env.MMX_TELEGRAM_TO_2 }}
token: ${{ env.MMX_TELEGRAM_TOKEN }}
format: html
message: |
MMX Node release ${{ steps.get_version.outputs.VERSION }}
${{ github.event.repository.url }}/releases/${{ steps.get_version.outputs.VERSION }}
<a href="https://t.me/mmx_node">Telegram channel</a>
<a href="https://t.me/mmx_node_chat">Telegram chat</a>
<a href="https://t.me/mmx_node_chat_ru">Telegram chat[RU]</a>
<a href="https://discord.gg/tCwevssVmY">Discord</a>
- name: Discord notification
if: ${{ env.DISCORD_WEBHOOK != '' }}
uses: Ilshidur/action-discord@master
with:
args: |
MMX Node release ${{ steps.get_version.outputs.VERSION }}
${{ github.event.repository.url }}/releases/${{ steps.get_version.outputs.VERSION }}