Skip to content

Bumped version from 6.6.2 → 6.6.3. #68

Bumped version from 6.6.2 → 6.6.3.

Bumped version from 6.6.2 → 6.6.3. #68

Workflow file for this run

name: yt_clipper
on:
push:
branches:
- release
- release/*
- test-ci
tags:
- 'v*'
pull_request:
branches:
- "*"
env:
NAME: nv_clipper
VERSION: '6.6.3'
jobs:
build:
defaults:
run:
shell: bash
runs-on: windows-latest
strategy:
max-parallel: 4
matrix:
node-version: ['20.16.x']
steps:
- name: Set derived environment variables
shell: bash
run: |
echo "WIN_ARTIFACT_NAME=${NAME}_win_${VERSION}" >> $GITHUB_ENV
echo "JS_ARTIFACT_NAME=${NAME}_${VERSION}.js" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up dirs
shell: bash
run: |
mkdir -p ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/{webms,bin,temp}/
mkdir -p ./bindeps
- name: Download ffmpeg dependency (windows)
shell: bash
run: |
cd ./bindeps
curl -o ./ffmpeg.zip -L https://github.com/GyanD/codexffmpeg/releases/download/7.1/ffmpeg-7.1-full_build-shared.7z
7z x ./ffmpeg.zip
mv ./ffmpeg-7.1-full_build-shared ffmpeg
./ffmpeg/bin/ffmpeg -version > version.txt
mv version.txt ffmpeg
ls -laR
- name: Download yt-dlp dependency
shell: bash
run: |
cd ./bindeps
mkdir -p yt-dlp/bin
cd yt-dlp/bin
curl -O -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe
chmod -v +x *
ls -laR
- name: Setup just
uses: extractions/setup-just@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
architecture: 'x64'
- name: Load cached node_modules
id: cached-node_modules
uses: actions/cache@v3
with:
path: node_modules
key: yarn-windows-latest-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: just bundle-prod
# Build GUI frontend only on PRs (we don't package a GUI exe in releases)
- name: Setup pnpm (for GUI build on PRs)
if: github.event_name == 'pull_request'
uses: pnpm/action-setup@v4
with:
version: 9
- name: Enable pnpm cache
if: github.event_name == 'pull_request'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: 'src/gui-frontend/pnpm-lock.yaml'
- name: Install GUI deps (pnpm)
if: github.event_name == 'pull_request'
working-directory: src/gui-frontend
run: pnpm install --frozen-lockfile
- name: Lint GUI frontend (PR only)
if: github.event_name == 'pull_request'
run: just gui-lint
- name: Build GUI frontend (PR only)
if: github.event_name == 'pull_request'
run: just gui-build
# Only run linter and tests for PRs, skip build and artifact steps
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.7.2'
enable-cache: true
cache-dependency-glob: 'uv.lock'
- name: Set up Python
run: uv python install
- name: Install the project (CPU-only)
run: uv sync --only-group cpu --only-group dev --only-group test
- name: Lint with ruff
run: just lint-py-fix
- name: Run clipper tests
run: just test-py
# Only build executables and upload artifacts on push to release or tag, not on PR
- name: Generate executable (CPU-only for all builds)
if: github.event_name != 'pull_request'
run: just build-py-cpu-fast
# Done with uv
- name: Minimize uv cache
run: uv cache prune --ci
- name: Copy artifacts (CPU-only build)
if: github.event_name != 'pull_request'
shell: bash
run: |
mv ./bindeps/ffmpeg/bin/* ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/bin/
mv ./bindeps/ffmpeg/*.txt ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/bin/
mv ./bindeps/yt-dlp/bin/* ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/bin/
cp ./src/clipper/include/* ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/
cp ./src/clipper/win_helpers/* ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/
mkdir -p ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/yt-dlp-plugins/ytc
cp -R ./src/clipper/yt-dlp-plugins/ytc/ ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/yt-dlp-plugins/
cp ./dist/py-cpu/yt_clipper* ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/
- name: Print clipper install version (windows)
if: github.event_name != 'pull_request'
run: ./dist/py-cpu/yt_clipper.exe --version
- name: Zip artifacts on windows
if: github.event_name != 'pull_request'
shell: powershell
run: |
Compress-Archive ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}/ ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}.zip
- name: Upload clipper script installation artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: ${{ env.NAME }}_win_${{ env.VERSION }}
path: ./artifact/py/${{ env.NAME }}_win_${{ env.VERSION }}.zip
- name: Rename JS bundle for artifact upload
if: github.event_name != 'pull_request'
run: cp ./dist/js/yt_clipper.js ./dist/js/${{ env.NAME }}_${{ env.VERSION }}.js
- name: Upload markup script installation artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: ${{ env.NAME }}_${{ env.VERSION }}.js
path: ./dist/js/${{ env.NAME }}_${{ env.VERSION }}.js
release:
needs: build
runs-on: windows-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Set derived environment variables
shell: bash
run: |
echo "WIN_ARTIFACT_NAME=${NAME}_win_${VERSION}" >> $GITHUB_ENV
echo "JS_ARTIFACT_NAME=${NAME}_${VERSION}.js" >> $GITHUB_ENV
- name: Set date for release
id: set_env
shell: bash
run: |
echo "date=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
name: ${{ env.NAME }}_win_${{ env.VERSION }}
path: ./
- uses: actions/download-artifact@v4
with:
name: ${{ env.NAME }}_${{ env.VERSION }}.js
path: ./
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: ${{ env.NAME }} v${{ env.VERSION }} [${{ steps.set_env.outputs.date }}]
draft: ${{ startsWith(github.ref, 'refs/tags/v') && 'false' || 'true' }}
prerelease: false
- name: Upload release asset (win)
id: upload-release-asset-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.NAME }}_win_${{ env.VERSION }}.zip
asset_name: ${{ env.NAME }}_win_${{ env.VERSION }}.zip
asset_content_type: application/zip
- name: Upload release asset (markup)
id: upload-release-asset-markup
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.NAME }}_${{ env.VERSION }}.js
asset_name: ${{ env.NAME }}_${{ env.VERSION }}.js
asset_content_type: text/javascript