Skip to content

Refactor background tests for video interaction logic #23

Refactor background tests for video interaction logic

Refactor background tests for video interaction logic #23

Workflow file for this run

name: 'Create Release'
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Generate changelog'
id: changelog
run: |
# Get current tag
CURRENT_TAG=${GITHUB_REF#refs/tags/}
# Get previous tag
PREVIOUS_TAG=$(git tag --sort=-creatordate | grep -A1 "^${CURRENT_TAG}$" | tail -n1)
# If no previous tag, use first commit
if [ -z "$PREVIOUS_TAG" ] || [ "$PREVIOUS_TAG" = "$CURRENT_TAG" ]; then
PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
echo "No previous tag found, using first commit"
fi
echo "Previous tag: $PREVIOUS_TAG"
echo "Current tag: $CURRENT_TAG"
# Generate commit log
CHANGELOG=$(git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:"- %s (%h)" --reverse)
# Handle multiline output
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: 'Create chrome-extension package'
run: |
cd chrome-extension
zip -r ../WebVideo2NAS-chrome-extension.zip . \
-x "tests/*" "tests/**" \
"node_modules/*" "node_modules/**" \
"vitest.config.js" \
"package.json" "package-lock.json"
- name: 'Create docker package'
run: |
cd video-downloader
zip -r ../WebVideo2NAS-downloader-docker.zip . \
-x "docker/api/tests/*" "docker/api/tests/**" \
"docker/worker/tests/*" "docker/worker/tests/**" \
"**/__pycache__/**" "**/.pytest_cache/**" \
"*.pyc" "*.pyo" "*.pyd"
- name: 'Create Release'
uses: softprops/action-gh-release@v2
with:
files: |
WebVideo2NAS-chrome-extension.zip
WebVideo2NAS-downloader-docker.zip
body: |
## What's Changed
${{ steps.changelog.outputs.changelog }}