mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
chore: making actions more efficient
This commit is contained in:
75
.github/workflows/build.yml
vendored
75
.github/workflows/build.yml
vendored
@ -42,6 +42,44 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# Only build without release if it is a fork
|
||||||
|
- name: Build on Mac
|
||||||
|
if: startsWith(matrix.os, 'macOS') && (github.repository == 'th-ch/youtube-music' && github.event_name == 'pull_request')
|
||||||
|
run: |
|
||||||
|
pnpm build:mac
|
||||||
|
|
||||||
|
- name: Build on Linux
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && (github.repository == 'th-ch/youtube-music' && github.event_name == 'pull_request')
|
||||||
|
run: |
|
||||||
|
pnpm build:linux
|
||||||
|
|
||||||
|
- name: Build on Windows
|
||||||
|
if: startsWith(matrix.os, 'windows') && (github.repository == 'th-ch/youtube-music' && github.event_name == 'pull_request')
|
||||||
|
run: |
|
||||||
|
pnpm build:win
|
||||||
|
|
||||||
|
# Build and release if it's the main repository and is not pull-request
|
||||||
|
- name: Build and release on Mac
|
||||||
|
if: startsWith(matrix.os, 'macOS') && (github.repository == 'th-ch/youtube-music' && github.event_name != 'pull_request')
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
pnpm release:mac
|
||||||
|
|
||||||
|
- name: Build and release on Linux
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && (github.repository == 'th-ch/youtube-music' && github.event_name != 'pull_request')
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
pnpm release:linux
|
||||||
|
|
||||||
|
- name: Build and release on Windows
|
||||||
|
if: startsWith(matrix.os, 'windows') && (github.repository == 'th-ch/youtube-music' && github.event_name != 'pull_request')
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
pnpm release:win
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
uses: coactions/setup-xvfb@v1
|
uses: coactions/setup-xvfb@v1
|
||||||
env:
|
env:
|
||||||
@ -49,43 +87,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
run: pnpm test:debug
|
run: pnpm test:debug
|
||||||
|
|
||||||
# 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.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
pnpm release:mac
|
|
||||||
|
|
||||||
- name: Build and release on Linux
|
|
||||||
if: startsWith(matrix.os, 'ubuntu') && github.repository == 'th-ch/youtube-music'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
pnpm release:linux
|
|
||||||
|
|
||||||
- name: Build and release on Windows
|
|
||||||
if: startsWith(matrix.os, 'windows') && github.repository == 'th-ch/youtube-music'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
pnpm 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: |
|
|
||||||
pnpm build:mac
|
|
||||||
|
|
||||||
- name: Build on Linux
|
|
||||||
if: startsWith(matrix.os, 'ubuntu') && github.repository != 'th-ch/youtube-music'
|
|
||||||
run: |
|
|
||||||
pnpm build:linux
|
|
||||||
|
|
||||||
- name: Build on Windows
|
|
||||||
if: startsWith(matrix.os, 'windows') && github.repository != 'th-ch/youtube-music'
|
|
||||||
run: |
|
|
||||||
pnpm build:win
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@ -87,8 +87,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "yarpm-pnpm run build && playwright test",
|
"test": "playwright test",
|
||||||
"test:debug": "yarpm-pnpm run build && cross-env DEBUG=pw:*,-pw:test:protocol playwright test",
|
"test:debug": "cross-env DEBUG=pw:*,-pw:test:protocol playwright test",
|
||||||
"rollup:preload": "rollup -c rollup.preload.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
|
"rollup:preload": "rollup -c rollup.preload.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
|
||||||
"rollup:main": "rollup -c rollup.main.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
|
"rollup:main": "rollup -c rollup.main.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
|
||||||
"build": "yarpm-pnpm run rollup:preload && yarpm-pnpm run rollup:main",
|
"build": "yarpm-pnpm run rollup:preload && yarpm-pnpm run rollup:main",
|
||||||
|
|||||||
Reference in New Issue
Block a user