Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
seproDev committed Apr 29, 2024
1 parent f1021d8 commit 3a95f2d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 10 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create release
on: [push]

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set variables
id: set_variables
run: |
echo "::group::Variables"
cat << EOF | tee -a "$GITHUB_OUTPUT"
tag=$(git describe --tags --abbrev=0)
version=v$(sed -n 's/^version\s*=\s*"\(.*\)"$/\1/p' pyproject.toml)
EOF
echo "::endgroup::"
- name: Bundle and create release
env:
GH_TOKEN: ${{ github.token }}
tag: ${{ steps.set_variables.outputs.tag }}
version: ${{ steps.set_variables.outputs.version }}
if: |
env.tag != env.version
run: |
files=(*)
mkdir bundle/
cp -rt bundle -- "${files[@]}"
cd bundle/
zip -9 --recurse-paths yt-dlp-ChromeCookieUnlock *
gh release create "${version}" --latest \
--title "yt-dlp-ChromeCookieUnlock ${version}" \
'yt-dlp-ChromeCookieUnlock.zip'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
*.egg-info/
*.pyc
dist/
21 changes: 17 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["hatchling >=1.9.0, <2"]
build-backend = "hatchling.build"

[tool.distutils.bdist_wheel]
universal = true
[project]
name = "yt-dlp-ChromeCookieUnlock"
description = "A yt-dlp plugin to unlock the cookie database of chromium-based browsers"
authors = [{name = "sepro", email = "[email protected]"}]
version = "2024.04.29"
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
keywords = [
"yt-dlp",
"yt-dlp-plugins",
]

[tool.hatch.build.targets.wheel]
packages = ["yt_dlp_plugins"]
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

0 comments on commit 3a95f2d

Please sign in to comment.