Skip to content

Commit 91b10ec

Browse files
committed
Set release flag instead of exit 0
1 parent 414edcb commit 91b10ec

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,23 +265,29 @@ jobs:
265265
steps:
266266
- shell: bash
267267
run: |
268+
release=true;
268269
if [ "${{ vars.target_os }}" ]; then
269270
if [ "${{ vars.target_os }}" != "${{ matrix.platform.release_for }}" ]; then
270271
echo "Skipping release for ${{ matrix.platform.release_for }}, expected ${{ vars.target_os }}"
271-
exit 0
272+
release=false;
272273
fi
273274
fi
275+
echo "release=$release" >> $GITHUB_ENV
274276
- uses: actions/checkout@v4
277+
if: env.release == 'true'
275278
with:
276279
fetch-depth: 0
277280
- uses: actions/setup-go@v5
281+
if: env.release == 'true'
278282
with:
279283
go-version: 1.21.0
280284
- uses: actions/setup-node@v4
285+
if: env.release == 'true'
281286
with:
282287
node-version: '18'
283288

284289
- name: Build Essentials
290+
if: env.release == 'true'
285291
run: |
286292
SHELL="/usr/bin/env bash"
287293
BASE_PATH="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
@@ -299,28 +305,33 @@ jobs:
299305
shell: bash
300306

301307
- name: Build Frontend
308+
if: env.release == 'true'
302309
run: cd frontend && npm ci && npm run build
303310
shell: bash
304311

305312
- name: Build Backend
313+
if: env.release == 'true'
306314
run: go build -ldflags "$LDFLAGS" -o .
307315
shell: bash
308316

309317
- name: Copy Artifact (Windows)
310-
if: ${{ matrix.platform.os == 'windows-latest' }}
318+
if: env.release == 'true' && matrix.platform.os == 'windows-latest'
311319
run: |
312320
mkdir -p ${{ matrix.platform.pkg-name }}
313321
cp ${{ matrix.platform.bin }} ${{ matrix.platform.pkg-name }}/${{ matrix.platform.bin }}
314-
Compress-Archive -DestinationPath ${{ matrix.platform.name }} -Path ${{ matrix.platform.pkg-name }}/
322+
Compress-Archive -DestinationPath ${{ matrix.platform.name }} -Path ${{ matrix.platform.pkg-name }}
323+
shell: bash
315324

316325
- name: Copy Artifact (macOS/Linux/RaspberryPi)
317-
if: ${{ matrix.platform.os != 'windows-latest' }}
326+
if: env.release == 'true' && matrix.platform.os != 'windows-latest'
318327
run: |
319328
mkdir -p ${{ matrix.platform.pkg-name }}
320329
cp ${{ matrix.platform.bin }} ${{ matrix.platform.pkg-name }}/${{ matrix.platform.bin }}
321-
tar -zcvf ${{ matrix.platform.name }} ${{ matrix.platform.pkg-name }}/
330+
tar -zcvf ${{ matrix.platform.name }} ${{ matrix.platform.pkg-name }}
331+
shell: bash
322332

323333
- name: Upload Asset
334+
if: env.release == 'true'
324335
run: |
325336
curl -X POST -H "Authorization: token ${{ secrets.GIT_TOKEN }}" \
326337
-H "Content-Type: application/octet-stream" \

0 commit comments

Comments
 (0)