-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (110 loc) · 4.01 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
name: Build and Release
on:
push:
tags:
- 'v*' # For releases
env:
SOLUTION_FILE_PATH: CRT.sln
BUILD_PLATFORM: x64
BUILD_CONFIGURATION: Release
permissions:
contents: write # Required for creating releases
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Restore NuGet packages
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: nuget restore ${{ env.SOLUTION_FILE_PATH }}
- name: Restore vcpkg packages
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: vcpkg integrate install
- name: Build
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} ${{ env.SOLUTION_FILE_PATH }}
- name: Copy oidn dll
run: cp ${{ github.workspace }}/libs/oidn/bin/*.dll ${{ github.workspace }}/x64/${{ env.BUILD_CONFIGURATION }}
- name: Copy openMP dll
run: cp ${{ github.workspace }}/libs/openMP/bin/*.dll ${{ github.workspace }}/x64/${{ env.BUILD_CONFIGURATION }}
- name: Copy forkawesome-webfont ttf
run: cp ${{ github.workspace }}/UI/app/forkawesome-webfont.ttf ${{ github.workspace }}/x64/${{ env.BUILD_CONFIGURATION }}
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v4
with:
name: build-binaries
path: |
${{ github.workspace }}/x64/${{ env.BUILD_CONFIGURATION }}/*
retention-days: 5
- name: Upload data as artifacts
uses: actions/upload-artifact@v4
with:
name: get-data
path: |
${{ github.workspace }}/data/*
retention-days: 5
release:
name: Create Release
needs: build
runs-on: windows-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-binaries
path: ./binaries/build-binaries.zip # Path to the binaries directory
- name: Display structure of downloaded files
run: ls -R ./binaries
- name: Download data artifacts
uses: actions/download-artifact@v4
with:
name: get-data
path: ./binaries/data.zip # Path to the binaries directory
- name: Create GitHub Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref_name }}
release_name: Cortex Raytracer ${{ github.ref_name }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false
- name: Zip binaries before upload release asset
uses: TheDoctor0/[email protected]
with:
type: 'zip'
filename: '.\win64-binaries.zip'
path: '.\binaries\build-binaries.zip\*'
exclusions: '*.pdb'
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .\win64-binaries.zip
asset_name: win64-binaries.zip
asset_content_type: application/zip
- name: Zip data before upload data asset
uses: TheDoctor0/[email protected]
with:
type: 'zip'
filename: '.\data.zip'
path: '.\binaries\data.zip\*'
exclusions: '*.max'
- name: Upload Data Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .\data.zip
asset_name: data.zip
asset_content_type: application/zip