Skip to content

Commit 8edf5aa

Browse files
committed
fix(ci): windows
1 parent f5a1e27 commit 8edf5aa

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
tags:
66
- '*'
7-
branches:
8-
- "actions"
97

108
env:
119
EXECUTABLES: "binary"
@@ -100,28 +98,48 @@ jobs:
10098
CCACHE_SLOPPINESS: time_macros
10199
OS: windows
102100
TARGET: "x86_64"
101+
BIN_NAME: "Raytracer"
102+
103103
steps:
104-
- uses: actions/checkout@v4
105-
- name: Set up cache
104+
- name: Checkout Repository
105+
uses: actions/checkout@v4
106+
107+
- name: Set up Cache
106108
uses: actions/cache@v4
107109
with:
108110
path: ${{ env.CCACHE_DIR }}
109111
key: ${{ runner.os }}-${{ env.TARGET }}-${{ github.sha }}
110112
restore-keys: |
111113
${{ runner.os }}-${{ env.TARGET }}-
114+
112115
- name: Make artifact folder
113116
run: New-Item -Path .\artifacts -ItemType Directory
117+
114118
- name: Setup MSBuild
115119
uses: microsoft/setup-msbuild@v2
116-
- name: Build
117-
run: msbuild {{ env.MS_BIN_NAME }}.vcxproj /p:Configuration=Release
118-
- name: Pack
119-
run: .\.github\pack\windows.ps1
120-
- name: Upload
120+
121+
- name: Build Project
122+
run: msbuild ${{ env.BIN_NAME }}.vcxproj /p:Configuration=Release
123+
124+
- name: Pack Executable into ZIP
125+
run: |
126+
mkdir artifacts
127+
cp .\Release\${{ env.BIN_NAME }}.exe artifacts\
128+
cp .\some_dependency.dll artifacts\ # Add other required files
129+
Compress-Archive -Path artifacts\* -DestinationPath ${{ env.BIN_NAME }}-windows.zip
130+
131+
- name: Upload ZIP as an Artifact
121132
uses: actions/upload-artifact@v4
122133
with:
123134
name: ${{ env.OS }}-${{ env.TARGET }}
124-
path: artifacts\
135+
path: ${{ env.BIN_NAME }}-windows.zip
136+
137+
- name: Create GitHub Release and Upload ZIP
138+
uses: softprops/action-gh-release@v1
139+
with:
140+
files: ${{ env.BIN_NAME }}-windows.zip
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125143

126144
release:
127145
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)