Skip to content

Commit 379703b

Browse files
authored
build: separate build step
1 parent f2b8dcf commit 379703b

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,28 @@ jobs:
102102
- uses: yuchanns/actions-luamake@v1.0.0
103103
with:
104104
luamake-version: "5bedfce66f075a9f68b1475747738b81b3b41c25"
105-
- name: Build
106-
id: build
105+
- name: Build (Windows)
106+
if: runner.os == 'Windows'
107+
shell: powershell
108+
id: build-windows
107109
run: |
108110
luamake precompile
109111
luamake soluna
110-
if [[ "$RUNNER_OS" == "Windows" ]]; then
111-
SOLUNA_BINARY="soluna.exe"
112-
RENAME_BINARY="soluna-windows-amd64.exe"
113-
else
114-
SOLUNA_BINARY="soluna"
115-
RENAME_BINARY="soluna-macos-arm64"
116-
fi
112+
$SOLUNA_BINARY = "soluna.exe"
113+
$RENAME_BINARY = "soluna-windows-amd64.exe"
114+
$SOLUNA_PATH = (Get-ChildItem -Path "bin" -Name $SOLUNA_BINARY -Recurse | Select-Object -First 1)
115+
Copy-Item "bin\$SOLUNA_PATH" "bin\$RENAME_BINARY"
116+
echo "SOLUNA_PATH=bin/$RENAME_BINARY" >> $env:GITHUB_OUTPUT
117+
echo "SOLUNA_BINARY=$RENAME_BINARY" >> $env:GITHUB_OUTPUT
118+
- name: Build (Unix)
119+
if: runner.os != 'Windows'
120+
shell: bash
121+
id: build-unix
122+
run: |
123+
luamake precompile
124+
luamake soluna
125+
SOLUNA_BINARY="soluna"
126+
RENAME_BINARY="soluna-macos-arm64"
117127
SOLUNA_PATH=$(find bin -name $SOLUNA_BINARY | head -n 1)
118128
cp "$SOLUNA_PATH" "bin/$RENAME_BINARY"
119129
echo "SOLUNA_PATH=bin/$RENAME_BINARY" >> $GITHUB_OUTPUT
@@ -122,9 +132,9 @@ jobs:
122132
name: Upload
123133
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
124134
with:
125-
name: "soluna-${{ runner.os }}-${{ steps.build.outputs.SOLUNA_BINARY }}"
135+
name: "soluna-${{ runner.os }}-${{ runner.os == 'Windows' && steps.build-windows.outputs.SOLUNA_BINARY || steps.build-unix.outputs.SOLUNA_BINARY }}"
126136
if-no-files-found: "error"
127-
path: "${{ steps.build.outputs.SOLUNA_PATH }}"
137+
path: "${{ runner.os == 'Windows' && steps.build-windows.outputs.SOLUNA_PATH || steps.build-unix.outputs.SOLUNA_PATH }}"
128138
overwrite: "true"
129139
release:
130140
name: Create Nightly Release

0 commit comments

Comments
 (0)