-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (78 loc) · 2.72 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
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: Upload binaries as artifacts
uses: actions/upload-artifact@v4
with:
name: build-binaries
path: |
${{ github.workspace }}/x64/${{ env.BUILD_CONFIGURATION }}/*
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: 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: Release ${{ github.ref_name }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false
- name: Zip 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