From b9aa6ffdd4de9dd56810b527caf509ef28c2b6fc Mon Sep 17 00:00:00 2001 From: TC Date: Thu, 9 Feb 2023 22:08:40 +0100 Subject: [PATCH] Only build without release if it is a fork --- .github/workflows/build.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6d384ff..b885ce89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,27 +65,44 @@ jobs: with: run: yarn test - - name: Build on Mac - if: startsWith(matrix.os, 'macOS') + # Build and release if it's the main repository + - name: Build and release on Mac + if: startsWith(matrix.os, 'macOS') && github.repository == 'th-ch/youtube-music' env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | yarn run release:mac - - name: Build on Linux - if: startsWith(matrix.os, 'ubuntu') + - name: Build and release on Linux + if: startsWith(matrix.os, 'ubuntu') && github.repository == 'th-ch/youtube-music' env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | yarn run release:linux - - name: Build on Windows - if: startsWith(matrix.os, 'windows') + - name: Build and release on Windows + if: startsWith(matrix.os, 'windows') && github.repository == 'th-ch/youtube-music' env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | yarn run release:win + # Only build without release if it is a fork + - name: Build on Mac + if: startsWith(matrix.os, 'macOS') && github.repository != 'th-ch/youtube-music' + run: | + yarn run build:mac + + - name: Build on Linux + if: startsWith(matrix.os, 'ubuntu') && github.repository != 'th-ch/youtube-music' + run: | + yarn run build:linux + + - name: Build on Windows + if: startsWith(matrix.os, 'windows') && github.repository != 'th-ch/youtube-music' + run: | + yarn run build:win + release: runs-on: ubuntu-latest name: Release YouTube Music