From 0fa190c3a8ab23755fc2fdc18d3fc70f87908bee Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sat, 31 Aug 2024 12:29:18 +0000 Subject: [PATCH 01/56] initial commit --- .github/workflows/release.yml | 130 ++++++++++++++++++++++++++++++++++ plugin/.gitignore | 2 + plugin/pyproject.toml | 26 +++++++ 3 files changed, 158 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 plugin/.gitignore create mode 100644 plugin/pyproject.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0323a50 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,130 @@ +name: Create release +on: + workflow_dispatch: + +jobs: + release: + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Install Hatch + run: pipx install hatch + + - name: Set variables + id: set_variables + run: | + tag="$(git describe --tags --abbrev=0)" + cd plugin/ + echo "::group::Variables" + cat << EOF | tee -a "$GITHUB_OUTPUT" + tag=${tag} + version=v$(hatch project metadata | jq -r .version) + 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: | + cd plugin/ + project_name="$(hatch project metadata | jq -r .name)" + sources="$(\ + hatch run default:pip list --verbose --format json \ + | jq -r '.[] | select(.editable_project_location == null) | "\(.name);\(.location)"' \ + )" + echo "::group::Dependencies" + printf '%s\n' "${sources}" + echo "::endgroup::" + mkdir bundle/ + cp -r yt_dlp_plugins bundle/ + while IFS=';' read -r name path; do + if [[ ! "${name}" =~ ^(pip|setuptools|wheel|yt-dlp)$ ]]; then + package_name="$(tr '[:upper:]' '[:lower:]' <<<"${name}" | sed 's/-/_/g')" + cp -r "${path}/${package_name}" bundle/ + fi + done <<<"${sources}" + cd bundle/ + find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete + zip -9 --recurse-paths "${project_name}" * + gh release create "${version}" --latest \ + --title "${project_name} ${version}" \ + "${project_name}.zip" + release_pypi: + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + permissions: + id-token: write # mandatory for trusted publishing + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build hatchling + + - name: Build + run: | + cp README.md plugin/ + cd plugin/ + rm -rf dist/** + printf '%s\n\n' \ + "Official repository: <${{ github.server_url }}/${{ github.repository }}>" > ./README.md.new + cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md + python -m build --no-isolation . + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + packages-dir: plugin/dist + release_docker: + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: name/app + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: server/ + file: server/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/plugin/.gitignore b/plugin/.gitignore new file mode 100644 index 0000000..47829bc --- /dev/null +++ b/plugin/.gitignore @@ -0,0 +1,2 @@ +dist/** +README.md diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml new file mode 100644 index 0000000..504fd23 --- /dev/null +++ b/plugin/pyproject.toml @@ -0,0 +1,26 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "bgutil-ytdlp-pot-provider" +version = "0.2.1" +readme = {file = "../README.md", content-type = "text/markdown"} +requires-python = ">=3.8" +keywords = ["yt-dlp", "yt-dlp-plugin"] +authors = [ + { name = "Brainicism", email = "brainicism@gmail.com" }, +] +dependencies = [ + 'yt-dlp-get-pot>=0.0.2', +] + +[tool.hatch.env.default] +installer = "uv" +path = ".venv" + +[tool.hatch.build.targets.wheel] +packages = ["yt_dlp_plugins"] + +[tool.hatch.metadata] +allow-direct-references = true From 5e5cc4fbd0c593bbeeebbe4b7313bdfed1b6c7f4 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sat, 31 Aug 2024 23:34:30 +0000 Subject: [PATCH 02/56] modified: .github/workflows/release.yml --- .github/workflows/release.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0323a50..3c7dc17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,13 +22,18 @@ jobs: - name: Set variables id: set_variables + shell: bash run: | - tag="$(git describe --tags --abbrev=0)" + tag="$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:lstrip=2)' --count=1)" + version=v$(hatch project metadata | jq -r .version) + if [ -z "$tag" ]; then + git tag ${version} + fi cd plugin/ echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" tag=${tag} - version=v$(hatch project metadata | jq -r .version) + version=${version} EOF echo "::endgroup::" - name: Bundle and create release @@ -96,8 +101,6 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: verbose: true - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ packages-dir: plugin/dist release_docker: # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') @@ -106,12 +109,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - run: env|sort # debugging - name: Docker meta id: meta uses: docker/metadata-action@v5 with: - images: name/app + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - name: Login to DockerHub if: github.event_name != 'pull_request' From cb04b51222c9f99e36ce675143e159481f36110b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sat, 31 Aug 2024 23:39:36 +0000 Subject: [PATCH 03/56] modified: .github/workflows/release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c7dc17..e3389ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: id: set_variables shell: bash run: | - tag="$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:lstrip=2)' --count=1)" + tag=`git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:lstrip=2)' --count=1` version=v$(hatch project metadata | jq -r .version) if [ -z "$tag" ]; then git tag ${version} From fc9ba16b0be877c359f158d3fc7be1e6de0f971e Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 00:19:29 +0000 Subject: [PATCH 04/56] fix path --- .github/workflows/release.yml | 11 +++++++---- plugin/pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3389ca..c10f221 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,11 +24,14 @@ jobs: id: set_variables shell: bash run: | - tag=`git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:lstrip=2)' --count=1` + tag=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:strip=2)' --count=1) + cd plugin/ version=v$(hatch project metadata | jq -r .version) - if [ -z "$tag" ]; then - git tag ${version} - fi + cd .. + # if [ -z "${tag}" ]; then + # git tag ${version} + # tag=${version} + # fi cd plugin/ echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 504fd23..97c7fde 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "bgutil-ytdlp-pot-provider" version = "0.2.1" -readme = {file = "../README.md", content-type = "text/markdown"} +readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] authors = [ From a24f95b59f7cdf7c7d3eb6faa4d0d0bb18bd7a5d Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 00:23:17 +0000 Subject: [PATCH 05/56] debug --- .github/workflows/release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c10f221..b1d8d80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,12 +26,9 @@ jobs: run: | tag=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:strip=2)' --count=1) cd plugin/ + echo "[debug] $(hatch project metadata)" version=v$(hatch project metadata | jq -r .version) cd .. - # if [ -z "${tag}" ]; then - # git tag ${version} - # tag=${version} - # fi cd plugin/ echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" From db39bb48d1fc5d31ce540ebe3029e65ea5c28324 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 00:27:05 +0000 Subject: [PATCH 06/56] fix --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1d8d80..d3c6d6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,8 @@ jobs: run: | tag=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:strip=2)' --count=1) cd plugin/ - echo "[debug] $(hatch project metadata)" + echo "$(hatch project metadata)" + cp README.md plugin/ version=v$(hatch project metadata | jq -r .version) cd .. cd plugin/ From 5bb8209b04752053bbdbc2fd99550a6dc1ca1999 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 00:29:04 +0000 Subject: [PATCH 07/56] fix --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3c6d6d..2207508 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,12 +25,10 @@ jobs: shell: bash run: | tag=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:strip=2)' --count=1) + cp README.md plugin/ cd plugin/ echo "$(hatch project metadata)" - cp README.md plugin/ version=v$(hatch project metadata | jq -r .version) - cd .. - cd plugin/ echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" tag=${tag} From ae1e32ad71a022fc11c268038d6e2d7c143fc51c Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 00:36:49 +0000 Subject: [PATCH 08/56] debug --- .github/workflows/release.yml | 9 ++++----- plugin/pyproject.toml | 4 +--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2207508..6ef4380 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: Create release on: workflow_dispatch: + push: jobs: release: @@ -27,12 +28,10 @@ jobs: tag=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:strip=2)' --count=1) cp README.md plugin/ cd plugin/ - echo "$(hatch project metadata)" - version=v$(hatch project metadata | jq -r .version) echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" tag=${tag} - version=${version} + version=v$(hatch project metadata | jq -r .version) EOF echo "::endgroup::" - name: Bundle and create release @@ -67,7 +66,7 @@ jobs: --title "${project_name} ${version}" \ "${project_name}.zip" release_pypi: - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: 0 runs-on: ubuntu-latest permissions: id-token: write # mandatory for trusted publishing @@ -102,7 +101,7 @@ jobs: verbose: true packages-dir: plugin/dist release_docker: - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: 0 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 97c7fde..21d5dff 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -11,9 +11,7 @@ keywords = ["yt-dlp", "yt-dlp-plugin"] authors = [ { name = "Brainicism", email = "brainicism@gmail.com" }, ] -dependencies = [ - 'yt-dlp-get-pot>=0.0.2', -] +dependencies = [] [tool.hatch.env.default] installer = "uv" From 725a869085b203340449fc036e1ddc3015ea527f Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:33:05 +0000 Subject: [PATCH 09/56] try: pypi --- .github/workflows/release.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ef4380..af87517 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,8 @@ name: Create release -on: - workflow_dispatch: - push: +on: [workflow_dispatch] jobs: release: - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') permissions: contents: write runs-on: ubuntu-latest @@ -23,7 +20,6 @@ jobs: - name: Set variables id: set_variables - shell: bash run: | tag=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:strip=2)' --count=1) cp README.md plugin/ @@ -65,8 +61,8 @@ jobs: gh release create "${version}" --latest \ --title "${project_name} ${version}" \ "${project_name}.zip" + release_pypi: - if: 0 runs-on: ubuntu-latest permissions: id-token: write # mandatory for trusted publishing @@ -100,9 +96,13 @@ jobs: with: verbose: true packages-dir: plugin/dist + release_docker: if: 0 + # temporarily disabled: necessary secrets not set runs-on: ubuntu-latest + permissions: + packages: write steps: - uses: actions/checkout@v4 with: @@ -113,20 +113,21 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + images: ${{ github.repository }} # like `brainicism/bgutil-ytdlp-pot-provider` - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ secrets.DOCKERHUB_USERNAME }} # set the secret + password: ${{ secrets.DOCKERHUB_TOKEN }} # set the secret - name: Build and push uses: docker/build-push-action@v5 with: context: server/ file: server/Dockerfile - push: ${{ github.event_name != 'pull_request' }} + # push: ${{ github.event_name != 'pull_request' }} + push: true # for debugging tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 43d19134da17fc53b44b8fca7e349b1c4a4b9583 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:43:49 +0000 Subject: [PATCH 10/56] modified project name for testing --- plugin/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 21d5dff..f2057ae 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -3,7 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "bgutil-ytdlp-pot-provider" +# name = "bgutil-ytdlp-pot-provider" +name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" version = "0.2.1" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" From 80232a90e5e1bce3f6e173aea90cb82f53536cda Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:16:06 +1200 Subject: [PATCH 11/56] test: docker --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af87517..c1a3509 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,8 +98,6 @@ jobs: packages-dir: plugin/dist release_docker: - if: 0 - # temporarily disabled: necessary secrets not set runs-on: ubuntu-latest permissions: packages: write @@ -107,7 +105,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - run: env|sort # debugging + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta From efb96bfe588421f4fd6128048010c0f8c2b758b0 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:51:10 +1200 Subject: [PATCH 12/56] change docker hub release condition --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1a3509..45ce5ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,7 +127,6 @@ jobs: with: context: server/ file: server/Dockerfile - # push: ${{ github.event_name != 'pull_request' }} - push: true # for debugging + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 082fce80d09679df75bdb42a11731b5a6c10ac89 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:33:35 +1200 Subject: [PATCH 13/56] - add docker meta tags - bump docker/build-push-action to v6 - add annotations metadata entry --- .github/workflows/release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45ce5ef..ece5865 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,7 +113,13 @@ jobs: id: meta uses: docker/metadata-action@v5 with: + context: git images: ${{ github.repository }} # like `brainicism/bgutil-ytdlp-pot-provider` + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=semver,pattern={{version}} + type=sha + type=raw,value=ci - name: Login to DockerHub if: github.event_name != 'pull_request' @@ -123,10 +129,11 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # set the secret - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: server/ file: server/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + annotations: ${{ steps.meta.outputs.annotations }} From 33c17c150455c3e27cd3388fd3bca8aa20a3c20d Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:13:44 +1200 Subject: [PATCH 14/56] - change taggerdate to creatordate - add a simple changelog to github release - run docker/pypi release after gh release as gh release workflow creates a new branch --- .github/workflows/release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ece5865..6875fbd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - name: Set variables id: set_variables run: | - tag=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:strip=2)' --count=1) + tag=$(git for-each-ref refs/tags --sort=-creatordate --format='%(refname:strip=2)' --count=1) cp README.md plugin/ cd plugin/ echo "::group::Variables" @@ -60,13 +60,14 @@ jobs: zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ --title "${project_name} ${version}" \ + --notes $'**Full Changelog**: [`${tag}...${version}`](https://github.com/Brainicism/bgutil-ytdlp-pot-provider/compare/${tag}...${version})\n'\ "${project_name}.zip" release_pypi: + needs: release runs-on: ubuntu-latest permissions: id-token: write # mandatory for trusted publishing - steps: - uses: actions/checkout@v4 with: @@ -98,6 +99,7 @@ jobs: packages-dir: plugin/dist release_docker: + needs: release runs-on: ubuntu-latest permissions: packages: write @@ -125,8 +127,8 @@ jobs: if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} # set the secret - password: ${{ secrets.DOCKERHUB_TOKEN }} # set the secret + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 From 49dc2a6fa0957c1e55bdf51a0c82fa579a1b2550 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:41:55 +1200 Subject: [PATCH 15/56] Rel 0.2.2 - docker rel: + version from github release workflow --- .github/workflows/release.yml | 7 ++++++- plugin/pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6875fbd..60caae3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,8 @@ jobs: permissions: contents: write runs-on: ubuntu-latest + outputs: + version: ${{ steps.set_variables.outputs.version }} steps: - uses: actions/checkout@v4 with: @@ -60,7 +62,7 @@ jobs: zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ --title "${project_name} ${version}" \ - --notes $'**Full Changelog**: [`${tag}...${version}`](https://github.com/Brainicism/bgutil-ytdlp-pot-provider/compare/${tag}...${version})\n'\ + --notes "**Full Changelog**: [\`\`]\(${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\)"\ "${project_name}.zip" release_pypi: @@ -122,6 +124,9 @@ jobs: type=semver,pattern={{version}} type=sha type=raw,value=ci + type=raw,value=${{ needs.release.outputs.version }} + + - run: echo ${{ needs.release.outputs.version }} - name: Login to DockerHub if: github.event_name != 'pull_request' diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index f2057ae..4a4d6ea 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.1" +version = "0.2.2" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 646e363ec0271d36fde95a4b516231aa52bbddea Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:53:03 +1200 Subject: [PATCH 16/56] rel 0.2.3 - [gh]fix changelog - [docker] try peter-evans/dockerhub-description@v4 --- .github/workflows/release.yml | 19 ++++++++++++++----- plugin/pyproject.toml | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60caae3..8715c59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ --title "${project_name} ${version}" \ - --notes "**Full Changelog**: [\`\`]\(${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\)"\ + --notes "**Full Changelog**: [\`${tag}...${version}\`]\(${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version})"\ "${project_name}.zip" release_pypi: @@ -105,6 +105,8 @@ jobs: runs-on: ubuntu-latest permissions: packages: write + env: + repository: ${{ github.repository }} # like `brainicism/bgutil-ytdlp-pot-provider` steps: - uses: actions/checkout@v4 with: @@ -118,16 +120,13 @@ jobs: uses: docker/metadata-action@v5 with: context: git - images: ${{ github.repository }} # like `brainicism/bgutil-ytdlp-pot-provider` + images: ${{ env.repository }} tags: | type=raw,value=latest,enable={{is_default_branch}} - type=semver,pattern={{version}} type=sha type=raw,value=ci type=raw,value=${{ needs.release.outputs.version }} - - run: echo ${{ needs.release.outputs.version }} - - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v3 @@ -144,3 +143,13 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }} + + - name: Update repo description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ env.repository }} + short-description: | + [short description placeholder] + readme-filepath: README.md diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 4a4d6ea..d61510a 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.2" +version = "0.2.3" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 10530407412743b27d6de8c6381b70bfdb69f828 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:29:40 +1200 Subject: [PATCH 17/56] rel 0.2.4 - [docker] get project description as docker img description - [docker] add official repository link - [pypi] remove `needs` to save time - [pypi] more concise builder --- .github/workflows/release.yml | 23 ++++++++++++++++------- plugin/pyproject.toml | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8715c59..7697041 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,11 +62,10 @@ jobs: zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ --title "${project_name} ${version}" \ - --notes "**Full Changelog**: [\`${tag}...${version}\`]\(${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version})"\ + --notes "**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}"\ "${project_name}.zip" release_pypi: - needs: release runs-on: ubuntu-latest permissions: id-token: write # mandatory for trusted publishing @@ -86,12 +85,11 @@ jobs: - name: Build run: | - cp README.md plugin/ cd plugin/ rm -rf dist/** printf '%s\n\n' \ "Official repository: <${{ github.server_url }}/${{ github.repository }}>" > ./README.md.new - cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md + cat ../README.md >> ./README.md.new && mv -f ./README.md.new ./README.md python -m build --no-isolation . - name: Publish to PyPI @@ -101,7 +99,7 @@ jobs: packages-dir: plugin/dist release_docker: - needs: release + needs: release runs-on: ubuntu-latest permissions: packages: write @@ -123,6 +121,7 @@ jobs: images: ${{ env.repository }} tags: | type=raw,value=latest,enable={{is_default_branch}} + # mark as latest only if built on default branch of repository type=sha type=raw,value=ci type=raw,value=${{ needs.release.outputs.version }} @@ -144,12 +143,22 @@ jobs: labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }} + - name: Add official repository link to README.md + run: | + printf '%s\n\n' \ + "Official repository: <${{ github.server_url }}/${{ github.repository }}>" > ./README.md.new + cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md + + - name: Get project description + id: get_desc + run: | + echo 'description=$(curl -Gso- "https://api.github.com/repos/${{ github.repository }}" |jq -r ".description")' | tee -a "$GITHUB_OUTPUT" + - name: Update repo description uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} repository: ${{ env.repository }} - short-description: | - [short description placeholder] + short-description: ${{ steps.get_desc.outputs.description }} readme-filepath: README.md diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index d61510a..2f97672 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.3" +version = "0.2.4" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 74572882f5fd3f2fe55b832e09ebfea4e2e667c2 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:06:28 +1200 Subject: [PATCH 18/56] rel 0.2.5 - [github] better changelog - [docker] fix description: extract from the `meta` step --- .github/workflows/release.yml | 12 +++++------- plugin/pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7697041..a78bce3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,10 @@ jobs: zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ --title "${project_name} ${version}" \ - --notes "**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}"\ + --notes \ + $'## What's Changed\n\n' \ + "$(git log ${tag}...${version} '--pretty=* %s by %an in %h')" \ + "**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}" \ "${project_name}.zip" release_pypi: @@ -149,16 +152,11 @@ jobs: "Official repository: <${{ github.server_url }}/${{ github.repository }}>" > ./README.md.new cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md - - name: Get project description - id: get_desc - run: | - echo 'description=$(curl -Gso- "https://api.github.com/repos/${{ github.repository }}" |jq -r ".description")' | tee -a "$GITHUB_OUTPUT" - - name: Update repo description uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} repository: ${{ env.repository }} - short-description: ${{ steps.get_desc.outputs.description }} + short-description: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.description'] }} readme-filepath: README.md diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 2f97672..1aaecd0 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.4" +version = "0.2.5" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From ec838ca2007a36c0c71a388e3677e18cf9c061ed Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:10:08 +1200 Subject: [PATCH 19/56] Release 0.2.6 - [github] fix unmatched single quotes --- .github/workflows/release.yml | 2 +- plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a78bce3..95e0362 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: gh release create "${version}" --latest \ --title "${project_name} ${version}" \ --notes \ - $'## What's Changed\n\n' \ + "## What's Changed"$'\n\n' \ "$(git log ${tag}...${version} '--pretty=* %s by %an in %h')" \ "**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}" \ "${project_name}.zip" diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 1aaecd0..1ea3475 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.5" +version = "0.2.6" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 5c981a225be3b29224fb32256e88e5e206aae6ac Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:13:52 +1200 Subject: [PATCH 20/56] Release 0.2.7 - [github] Fix git log cmd when generating changelog: branch not yet created --- .github/workflows/release.yml | 2 +- plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95e0362..4c25654 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: --title "${project_name} ${version}" \ --notes \ "## What's Changed"$'\n\n' \ - "$(git log ${tag}...${version} '--pretty=* %s by %an in %h')" \ + "$(git log ${tag} '--pretty=* %s by %an in %h')" \ "**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}" \ "${project_name}.zip" diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 1ea3475..e1f07ad 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.6" +version = "0.2.7" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From b51c074e3bc1c90de2866f5e5252bc1714a543cd Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:36:34 +1200 Subject: [PATCH 21/56] REL0.2.8: [gh] fix CHANGELOG --- .github/workflows/release.yml | 8 ++++---- plugin/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c25654..d67d3a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,9 @@ jobs: env.tag != env.version run: | cd plugin/ + printf "## What's Changed\n\n" >> CHANGELOG.md + git log ${tag} '--pretty=* %s by %an in %h' >> CHANGELOG.md + printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md project_name="$(hatch project metadata | jq -r .name)" sources="$(\ hatch run default:pip list --verbose --format json \ @@ -62,10 +65,7 @@ jobs: zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ --title "${project_name} ${version}" \ - --notes \ - "## What's Changed"$'\n\n' \ - "$(git log ${tag} '--pretty=* %s by %an in %h')" \ - "**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}" \ + --notes-file CHANGELOG.md \ "${project_name}.zip" release_pypi: diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index e1f07ad..09d915e 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.7" +version = "0.2.8" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From b243e52ed3102bf70a518dc885e5252e1595170b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:39:13 +1200 Subject: [PATCH 22/56] REL 0.2.9: [gh] fix changelog path --- .github/workflows/release.yml | 6 +++--- plugin/pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d67d3a7..6ab248f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,9 +41,6 @@ jobs: env.tag != env.version run: | cd plugin/ - printf "## What's Changed\n\n" >> CHANGELOG.md - git log ${tag} '--pretty=* %s by %an in %h' >> CHANGELOG.md - printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md project_name="$(hatch project metadata | jq -r .name)" sources="$(\ hatch run default:pip list --verbose --format json \ @@ -61,6 +58,9 @@ jobs: fi done <<<"${sources}" cd bundle/ + printf "## What's Changed\n\n" >> CHANGELOG.md + git log ${tag} '--pretty=* %s by %an in %h' >> CHANGELOG.md + printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 09d915e..1fce5c4 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.8" +version = "0.2.9" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 1fb04c2a4df115b63f9002fb2126d7cf4ef8475b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:56:06 +1200 Subject: [PATCH 23/56] - [github] fix git log - [github] change git log format --- .github/workflows/release.yml | 2 +- plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ab248f..44c2468 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,7 @@ jobs: done <<<"${sources}" cd bundle/ printf "## What's Changed\n\n" >> CHANGELOG.md - git log ${tag} '--pretty=* %s by %an in %h' >> CHANGELOG.md + git log '--pretty=* %h(by %an<%ae>) %B' --reverse ${tag}...HEAD >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete zip -9 --recurse-paths "${project_name}" * diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 1fce5c4..5ad0eb9 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.9" +version = "0.2.10" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 33a3ad57851e8fbbd28d78fa4ed7b38e269b5c43 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:57:10 +1200 Subject: [PATCH 24/56] [pypi] test: add yt-dlp-get-pot as a dep --- plugin/pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 5ad0eb9..9d9c52f 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -12,7 +12,9 @@ keywords = ["yt-dlp", "yt-dlp-plugin"] authors = [ { name = "Brainicism", email = "brainicism@gmail.com" }, ] -dependencies = [] +dependencies = [ + "yt-dlp-get-pot>=0.2", +] [tool.hatch.env.default] installer = "uv" From a51080a2dfb99528b2394899a789554121763a32 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:03:01 +1200 Subject: [PATCH 25/56] REL 0.2.11 [github] fix dep ver --- plugin/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 9d9c52f..934c849 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.10" +version = "0.2.11" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] @@ -13,7 +13,7 @@ authors = [ { name = "Brainicism", email = "brainicism@gmail.com" }, ] dependencies = [ - "yt-dlp-get-pot>=0.2", + "yt-dlp-get-pot>=0.0.2", ] [tool.hatch.env.default] From f4f0d30643a7b710a9526cb19eef9dd0a0950024 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:09:49 +1200 Subject: [PATCH 26/56] REL 0.2.12 [github] try to fix dep error --- .github/workflows/release.yml | 1 + plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44c2468..ae764a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,7 @@ jobs: env.tag != env.version run: | cd plugin/ + pip install . project_name="$(hatch project metadata | jq -r .name)" sources="$(\ hatch run default:pip list --verbose --format json \ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 934c849..3e9937a 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.11" +version = "0.2.12" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From d461c28ff266b7cec539ba43d361cd6c61c37905 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:18:03 +1200 Subject: [PATCH 27/56] rel 0.2.13: debug --- .github/workflows/release.yml | 2 +- plugin/pyproject.toml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae764a7..f1bbe33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,6 @@ jobs: env.tag != env.version run: | cd plugin/ - pip install . project_name="$(hatch project metadata | jq -r .name)" sources="$(\ hatch run default:pip list --verbose --format json \ @@ -63,6 +62,7 @@ jobs: git log '--pretty=* %h(by %an<%ae>) %B' --reverse ${tag}...HEAD >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete + ls -al # debugging zip -9 --recurse-paths "${project_name}" * gh release create "${version}" --latest \ --title "${project_name} ${version}" \ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 3e9937a..240225f 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,16 +5,14 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.12" +version = "0.2.13" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] authors = [ { name = "Brainicism", email = "brainicism@gmail.com" }, ] -dependencies = [ - "yt-dlp-get-pot>=0.0.2", -] +dependencies = [] [tool.hatch.env.default] installer = "uv" From c058b9a9ba037659568f765030b4f32cca5c5ca5 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:24:16 +1200 Subject: [PATCH 28/56] REL 0.2.14 - [github] try to escape `<`&`>` - [github] try to remove dependencies from bundle --- .github/workflows/release.yml | 28 ++++++++++++++-------------- plugin/pyproject.toml | 6 ++++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1bbe33..259ccb7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,24 +42,24 @@ jobs: run: | cd plugin/ project_name="$(hatch project metadata | jq -r .name)" - sources="$(\ - hatch run default:pip list --verbose --format json \ - | jq -r '.[] | select(.editable_project_location == null) | "\(.name);\(.location)"' \ - )" - echo "::group::Dependencies" - printf '%s\n' "${sources}" - echo "::endgroup::" + # sources="$(\ + # hatch run default:pip list --verbose --format json \ + # | jq -r '.[] | select(.editable_project_location == null) | "\(.name);\(.location)"' \ + # )" + # echo "::group::Dependencies" + # printf '%s\n' "${sources}" + # echo "::endgroup::" mkdir bundle/ cp -r yt_dlp_plugins bundle/ - while IFS=';' read -r name path; do - if [[ ! "${name}" =~ ^(pip|setuptools|wheel|yt-dlp)$ ]]; then - package_name="$(tr '[:upper:]' '[:lower:]' <<<"${name}" | sed 's/-/_/g')" - cp -r "${path}/${package_name}" bundle/ - fi - done <<<"${sources}" + # while IFS=';' read -r name path; do + # if [[ ! "${name}" =~ ^(pip|setuptools|wheel|yt-dlp)$ ]]; then + # package_name="$(tr '[:upper:]' '[:lower:]' <<<"${name}" | sed 's/-/_/g')" + # cp -r "${path}/${package_name}" bundle/ + # fi + # done <<<"${sources}" cd bundle/ printf "## What's Changed\n\n" >> CHANGELOG.md - git log '--pretty=* %h(by %an<%ae>) %B' --reverse ${tag}...HEAD >> CHANGELOG.md + git log '--pretty=* %h(by %an\<%ae\>) %B' --reverse ${tag}...HEAD >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete ls -al # debugging diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 240225f..cf96423 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,14 +5,16 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.13" +version = "0.2.14" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] authors = [ { name = "Brainicism", email = "brainicism@gmail.com" }, ] -dependencies = [] +dependencies = [ + "yt-dlp-get-pot>=0.0.2", +] [tool.hatch.env.default] installer = "uv" From 24b1a15f3b911e5f5875dc408355f5c70bc6f4fa Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 23:02:01 +1200 Subject: [PATCH 29/56] REL 0.2.15 - [github] dont include changelog in the release file: users - [github] completely remove dependencies packing code - [plugin] update `plugin/.gitignore` - [github] try to display commit msg in md code block in changelog --- .github/workflows/release.yml | 23 ++++------------------- plugin/.gitignore | 4 ++++ plugin/pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 259ccb7..228f8dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,33 +37,18 @@ jobs: GH_TOKEN: ${{ github.token }} tag: ${{ steps.set_variables.outputs.tag }} version: ${{ steps.set_variables.outputs.version }} - if: | - env.tag != env.version + if: env.tag != env.version run: | cd plugin/ project_name="$(hatch project metadata | jq -r .name)" - # sources="$(\ - # hatch run default:pip list --verbose --format json \ - # | jq -r '.[] | select(.editable_project_location == null) | "\(.name);\(.location)"' \ - # )" - # echo "::group::Dependencies" - # printf '%s\n' "${sources}" - # echo "::endgroup::" mkdir bundle/ cp -r yt_dlp_plugins bundle/ - # while IFS=';' read -r name path; do - # if [[ ! "${name}" =~ ^(pip|setuptools|wheel|yt-dlp)$ ]]; then - # package_name="$(tr '[:upper:]' '[:lower:]' <<<"${name}" | sed 's/-/_/g')" - # cp -r "${path}/${package_name}" bundle/ - # fi - # done <<<"${sources}" cd bundle/ - printf "## What's Changed\n\n" >> CHANGELOG.md - git log '--pretty=* %h(by %an\<%ae\>) %B' --reverse ${tag}...HEAD >> CHANGELOG.md - printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete - ls -al # debugging zip -9 --recurse-paths "${project_name}" * + printf "## What's Changed\n\n" >> CHANGELOG.md + git log '--pretty=* %h(by %an\<%ae\>) %s%n```md%n%b%n```' --reverse ${tag}...HEAD >> CHANGELOG.md + printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ --title "${project_name} ${version}" \ --notes-file CHANGELOG.md \ diff --git a/plugin/.gitignore b/plugin/.gitignore index 47829bc..d237d8f 100644 --- a/plugin/.gitignore +++ b/plugin/.gitignore @@ -1,2 +1,6 @@ dist/** README.md +CHANGELOG.md +*.pyc +*.pyo +__pycache__/ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index cf96423..23c77a9 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.14" +version = "0.2.15" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From f19300fe510a19156a7e270cfe46524d8d2baa83 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 1 Sep 2024 23:07:12 +1200 Subject: [PATCH 30/56] REL 0.2.16 - [github] changelog: use commit body --- .github/workflows/release.yml | 2 +- plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 228f8dc..83d956b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete zip -9 --recurse-paths "${project_name}" * printf "## What's Changed\n\n" >> CHANGELOG.md - git log '--pretty=* %h(by %an\<%ae\>) %s%n```md%n%b%n```' --reverse ${tag}...HEAD >> CHANGELOG.md + git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ --title "${project_name} ${version}" \ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 23c77a9..9faedf1 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.15" +version = "0.2.16" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From acd2121482fdfd4bcb8ee9b46afc59e8031ef045 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:55:16 +1200 Subject: [PATCH 31/56] REL 0.2.17 - try to change changelog format --- .github/workflows/release.yml | 6 +++++- plugin/pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83d956b..59c6b0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,11 @@ jobs: find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete zip -9 --recurse-paths "${project_name}" * printf "## What's Changed\n\n" >> CHANGELOG.md - git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md + # git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md + gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ + | jq -r --arg creatortime "$(git for-each-ref --format '%(creatordate)' refs/tags/${tag})" \ + '.[]|select(.mergedAt>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by \(.author.login) (#\(.number|tostring))"' \ + >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ --title "${project_name} ${version}" \ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 9faedf1..35c68c1 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.16" +version = "0.2.17" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 6477895b3e6057e6d3c14e6e27225f40a2245b07 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:58:31 +1200 Subject: [PATCH 32/56] REL 0.2.18 increment version [description placeholder line 1] [description placeholder line 2] --- plugin/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 35c68c1..0cd503d 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.17" +version = "0.2.18" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 7a3e2c3ec159fc6c3586c2d8530e9da6234b3ceb Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:03:50 +1200 Subject: [PATCH 33/56] [github] change changelog format --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59c6b0f..a8bf51b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: # git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ | jq -r --arg creatortime "$(git for-each-ref --format '%(creatordate)' refs/tags/${tag})" \ - '.[]|select(.mergedAt>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by \(.author.login) (#\(.number|tostring))"' \ + '.[]|select(.mergedAt>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) #\(.number|tostring)"' \ >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ From 2793ff5776494f8037c9b1ce61f5f7c7dae133ee Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:05:29 +1200 Subject: [PATCH 34/56] [REL0.2.19] Increment version DESC-1 DESC-2 --- plugin/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 0cd503d..4764c06 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.18" +version = "0.2.19" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From e3ee0e022bbd1b60f80e741d32bfcf5e6f443c23 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:12:21 +1200 Subject: [PATCH 35/56] REL 0.2.20 - [gh] fix changelog --- .github/workflows/release.yml | 2 +- plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8bf51b..423193a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: # git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ | jq -r --arg creatortime "$(git for-each-ref --format '%(creatordate)' refs/tags/${tag})" \ - '.[]|select(.mergedAt>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) #\(.number|tostring)"' \ + '.[]|select((.mergedAt|strptime("%a %b %d %H:%M:%S %Y %z")|mktime)>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 4764c06..615b20f 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.19" +version = "0.2.20" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From c0e05a0915d5f12b8a16fb3dffdcd6fe9b6703ac Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:16:21 +1200 Subject: [PATCH 36/56] rel 0.2.21 - fix time format --- .github/workflows/release.yml | 2 +- plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 423193a..5baa07e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: # git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ | jq -r --arg creatortime "$(git for-each-ref --format '%(creatordate)' refs/tags/${tag})" \ - '.[]|select((.mergedAt|strptime("%a %b %d %H:%M:%S %Y %z")|mktime)>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ + '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 615b20f..0d07849 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.20" +version = "0.2.21" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 3f1fe3e3052f6389b03f37965e4a1c41d2185e58 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:18:53 +1200 Subject: [PATCH 37/56] increment version d --- plugin/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 0d07849..945aa32 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.21" +version = "0.2.22" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From ea896bcc3633e0f664517c223b232bda46e40359 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:23:15 +1200 Subject: [PATCH 38/56] [gh] fix time range for changelog --- .github/workflows/release.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5baa07e..d2c8688 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,10 +48,16 @@ jobs: zip -9 --recurse-paths "${project_name}" * printf "## What's Changed\n\n" >> CHANGELOG.md # git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md - gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ - | jq -r --arg creatortime "$(git for-each-ref --format '%(creatordate)' refs/tags/${tag})" \ - '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ + # gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ + # | jq -r --arg creatortime "$(git for-each-ref --format '%(creatordate)' refs/tags/${tag})" \ + # '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ + # >> CHANGELOG.md + + gh pr list --json author,number,title,mergedAt --state merged -R grqz/bgutil-ytdlp-pot-provider \ + | jq -r --arg authortime "$(git log --format='%at' -n1 ${tag})" \ + '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($authortime|tonumber))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ >> CHANGELOG.md + printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ --title "${project_name} ${version}" \ From e1aca225ff25c14201edb462a967123ec61e1383 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:24:12 +1200 Subject: [PATCH 39/56] 0.2.23 Update pyproject.toml --- plugin/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 945aa32..7010d82 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.22" +version = "0.2.23" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 892c53eaee1430e407b1eef0a5f27dab67e74163 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:26:31 +1200 Subject: [PATCH 40/56] version 0.2.24 Update pyproject.toml --- plugin/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 7010d82..82fc43d 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -version = "0.2.23" +version = "0.2.24" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From fba1f6def89db1fe234a49010e4c5d01802b6867 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:28:05 +1200 Subject: [PATCH 41/56] test pr --- plugin/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 82fc43d..2e5c1e7 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -5,6 +5,7 @@ build-backend = "hatchling.build" [project] # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" +# version = "0.2.1" version = "0.2.24" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" From 283ba9f5c6f16b2b1f5c8fdd5aacc8b1cc5642d1 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:16:31 +1200 Subject: [PATCH 42/56] test the workflow triggered by a pr - [gh] cleanup --- .github/workflows/release.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2c8688..09ef728 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,13 @@ name: Create release -on: [workflow_dispatch] +on: + workflow_dispatch: + pull_request: jobs: release: + name: Release to Github + if: ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} + # only release on default branch permissions: contents: write runs-on: ubuntu-latest @@ -47,17 +52,10 @@ jobs: find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete zip -9 --recurse-paths "${project_name}" * printf "## What's Changed\n\n" >> CHANGELOG.md - # git log '--pretty=* %h(by %an\<%ae\>)%n```md%n%B%n```' --reverse ${tag}...HEAD >> CHANGELOG.md - # gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ - # | jq -r --arg creatortime "$(git for-each-ref --format '%(creatordate)' refs/tags/${tag})" \ - # '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($creatortime|strptime("%a %b %d %H:%M:%S %Y %z")|mktime))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ - # >> CHANGELOG.md - - gh pr list --json author,number,title,mergedAt --state merged -R grqz/bgutil-ytdlp-pot-provider \ + gh pr list --json author,number,title,mergedAt --state merged -R ${{ github.repository }} \ | jq -r --arg authortime "$(git log --format='%at' -n1 ${tag})" \ '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($authortime|tonumber))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ >> CHANGELOG.md - printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md gh release create "${version}" --latest \ --title "${project_name} ${version}" \ @@ -65,6 +63,9 @@ jobs: "${project_name}.zip" release_pypi: + name: Release to PyPI + if: ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} + # only release on default branch runs-on: ubuntu-latest permissions: id-token: write # mandatory for trusted publishing @@ -98,7 +99,8 @@ jobs: packages-dir: plugin/dist release_docker: - needs: release + name: Release to Docker Hub + needs: release runs-on: ubuntu-latest permissions: packages: write @@ -143,12 +145,14 @@ jobs: annotations: ${{ steps.meta.outputs.annotations }} - name: Add official repository link to README.md + if: ${{ github.event_name != 'pull_request' }} run: | printf '%s\n\n' \ "Official repository: <${{ github.server_url }}/${{ github.repository }}>" > ./README.md.new cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md - name: Update repo description + if: ${{ github.event_name != 'pull_request' }} uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} From 0696592ccf2092120f76c7dd745e273aaadde7c9 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:24:31 +1200 Subject: [PATCH 43/56] [gh] remove git tag prefix - [gh] fix pr run condition --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09ef728..3347402 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,6 @@ on: jobs: release: name: Release to Github - if: ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} # only release on default branch permissions: contents: write @@ -34,7 +33,7 @@ jobs: echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" tag=${tag} - version=v$(hatch project metadata | jq -r .version) + version=$(hatch project metadata | jq -r .version) EOF echo "::endgroup::" - name: Bundle and create release @@ -42,7 +41,8 @@ jobs: GH_TOKEN: ${{ github.token }} tag: ${{ steps.set_variables.outputs.tag }} version: ${{ steps.set_variables.outputs.version }} - if: env.tag != env.version + if: | + env.tag != env.version && ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} run: | cd plugin/ project_name="$(hatch project metadata | jq -r .name)" From 05992bdee11bdbc881fb748dd187a5b158d392c7 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:30:15 +1200 Subject: [PATCH 44/56] - [docker] more tags - [gh] fix release condition --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3347402..b6761f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: tag: ${{ steps.set_variables.outputs.tag }} version: ${{ steps.set_variables.outputs.version }} if: | - env.tag != env.version && ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} + ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && env.tag != env.version }} run: | cd plugin/ project_name="$(hatch project metadata | jq -r .name)" @@ -126,6 +126,8 @@ jobs: type=sha type=raw,value=ci type=raw,value=${{ needs.release.outputs.version }} + type=ref,event=branch + type=ref,event=pr - name: Login to DockerHub if: github.event_name != 'pull_request' From bd30d3b76f5b9dc6d21cb527f540a1b5cd56ef0e Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:39:50 +1200 Subject: [PATCH 45/56] [gh] try to fix create release if condition --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6761f6..af7c713 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,12 +37,11 @@ jobs: EOF echo "::endgroup::" - name: Bundle and create release + if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && env.tag != env.version env: GH_TOKEN: ${{ github.token }} tag: ${{ steps.set_variables.outputs.tag }} version: ${{ steps.set_variables.outputs.version }} - if: | - ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && env.tag != env.version }} run: | cd plugin/ project_name="$(hatch project metadata | jq -r .name)" From dfb88145d8634ca1c6f16acea48e532be4e5c856 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:48:22 +1200 Subject: [PATCH 46/56] REL 0.2.26 - [gh] remove the redundant assignment to `tag` --- .github/workflows/release.yml | 3 +-- plugin/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af7c713..ed38d85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,12 +27,11 @@ jobs: - name: Set variables id: set_variables run: | - tag=$(git for-each-ref refs/tags --sort=-creatordate --format='%(refname:strip=2)' --count=1) cp README.md plugin/ cd plugin/ echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" - tag=${tag} + tag=$(git for-each-ref refs/tags --sort=-creatordate --format='%(refname:strip=2)' --count=1) version=$(hatch project metadata | jq -r .version) EOF echo "::endgroup::" diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 2e5c1e7..762999c 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" # version = "0.2.1" -version = "0.2.24" +version = "0.2.26" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 58f97ebcc8a1405c8975c90c64a39da01b19a2d7 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:04:57 +1200 Subject: [PATCH 47/56] REL 0.2.27 - fix docker tags for pr - [docker] cleanup --- .github/workflows/release.yml | 10 ++++++---- plugin/pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed38d85..e288907 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,9 +121,11 @@ jobs: tags: | type=raw,value=latest,enable={{is_default_branch}} # mark as latest only if built on default branch of repository + type=raw,value=ci,enable={{is_default_branch}} + # mark as ci only if built on default branch of repository + type=raw,value=${{ needs.release.outputs.version }},enable={{is_default_branch}} + # add the new git tag only if built on default branch of repository type=sha - type=raw,value=ci - type=raw,value=${{ needs.release.outputs.version }} type=ref,event=branch type=ref,event=pr @@ -145,14 +147,14 @@ jobs: annotations: ${{ steps.meta.outputs.annotations }} - name: Add official repository link to README.md - if: ${{ github.event_name != 'pull_request' }} + if: github.event_name != 'pull_request' run: | printf '%s\n\n' \ "Official repository: <${{ github.server_url }}/${{ github.repository }}>" > ./README.md.new cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md - name: Update repo description - if: ${{ github.event_name != 'pull_request' }} + if: github.event_name != 'pull_request' uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 762999c..35c6dc2 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" # version = "0.2.1" -version = "0.2.26" +version = "0.2.27" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From fee5fc39d3b3fe100c9b5c95e00a060be81765ec Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:08:30 +1200 Subject: [PATCH 48/56] REL:0.2.27 [gh] cleanup: correct annotation position --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e288907..93e5799 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,6 @@ on: jobs: release: name: Release to Github - # only release on default branch permissions: contents: write runs-on: ubuntu-latest @@ -29,21 +28,24 @@ jobs: run: | cp README.md plugin/ cd plugin/ + metadata=$(hatch project metadata) echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" tag=$(git for-each-ref refs/tags --sort=-creatordate --format='%(refname:strip=2)' --count=1) - version=$(hatch project metadata | jq -r .version) + version=$(echo ${metadata} | jq -r .version) + project_name=$(echo ${metadata} | jq -r .name) EOF echo "::endgroup::" - name: Bundle and create release if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && env.tag != env.version + # only release on default branch env: GH_TOKEN: ${{ github.token }} tag: ${{ steps.set_variables.outputs.tag }} version: ${{ steps.set_variables.outputs.version }} + project_name: ${{ steps.set_variables.outputs.project_name }} run: | cd plugin/ - project_name="$(hatch project metadata | jq -r .name)" mkdir bundle/ cp -r yt_dlp_plugins bundle/ cd bundle/ From 7b14ef50401adb33585a85c3668a1ea8ae8fed55 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:19:22 +1200 Subject: [PATCH 49/56] Delete build.yml --- .github/workflows/build.yml | 26 -------------------------- .github/workflows/release.yml | 6 +++++- 2 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 31b027c..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: build - -on: - workflow_dispatch: - push: - branches: [master] - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Checkout bgutil-ytdlp-pot-provider - uses: actions/checkout@v4 - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - context: server/ - file: server/Dockerfile - push: false - tags: brainicism/bgutil-ytdlp-pot-provider:ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93e5799..5a3dcf3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,10 @@ on: workflow_dispatch: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: release: name: Release to Github @@ -99,7 +103,7 @@ jobs: packages-dir: plugin/dist release_docker: - name: Release to Docker Hub + name: Build Docker Image needs: release runs-on: ubuntu-latest permissions: From 8fb155444f3eb7818dfe9c6e2c4680a78f1cf09b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:20:56 +1200 Subject: [PATCH 50/56] REL 0.2.28 Prob last build, just to test whether everything is working --- plugin/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 35c6dc2..9cf292b 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" # version = "0.2.1" -version = "0.2.27" +version = "0.2.28" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 6a1c87c06b572b0660d36a3d9a614f27a2b0b3aa Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:46:13 +1200 Subject: [PATCH 51/56] try to allow overwriting github releases --- .github/workflows/release.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a3dcf3..48e5c4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,9 +40,10 @@ jobs: project_name=$(echo ${metadata} | jq -r .name) EOF echo "::endgroup::" - - name: Bundle and create release + - name: Bundle if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && env.tag != env.version # only release on default branch + id: bundle env: GH_TOKEN: ${{ github.token }} tag: ${{ steps.set_variables.outputs.tag }} @@ -61,14 +62,26 @@ jobs: '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($authortime|tonumber))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md - gh release create "${version}" --latest \ - --title "${project_name} ${version}" \ - --notes-file CHANGELOG.md \ - "${project_name}.zip" + echo "changelog=$(cat CHANGELOG.md)" | tee -a "$GITHUB_OUTPUT" + # gh release create "${version}" --latest \ + # --title "${project_name} ${version}" \ + # --notes-file CHANGELOG.md \ + # "${project_name}.zip" + + - name: Create Release on Github + uses: svenstaro/upload-release-action@v2 + with: + tag: ${{ steps.set_variables.outputs.version }} + release_name: | + ${{ steps.set_variables.outputs.project_name }} ${{ steps.set_variables.outputs.version }} + body: ${{ steps.bundle.outputs.changelog }} + file: plugin/bundle/${{ steps.set_variables.outputs.project_name }}.zip + asset_name: ${{ steps.set_variables.outputs.project_name }}.zip + overwrite: true release_pypi: name: Release to PyPI - if: ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} + if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref # only release on default branch runs-on: ubuntu-latest permissions: From c1e7a63b99848aa3fcead8a90032afd3594d9fe7 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:47:56 +1200 Subject: [PATCH 52/56] [gh] fix condition --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48e5c4c..9620dcb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: EOF echo "::endgroup::" - name: Bundle - if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && env.tag != env.version + if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref # only release on default branch id: bundle env: @@ -69,6 +69,8 @@ jobs: # "${project_name}.zip" - name: Create Release on Github + if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref + # only release on default branch uses: svenstaro/upload-release-action@v2 with: tag: ${{ steps.set_variables.outputs.version }} From 210d11af4d96849e2b3034038437a37e49bc92aa Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:54:12 +1200 Subject: [PATCH 53/56] read from release notes --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9620dcb..50e6a4e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,6 +49,7 @@ jobs: tag: ${{ steps.set_variables.outputs.tag }} version: ${{ steps.set_variables.outputs.version }} project_name: ${{ steps.set_variables.outputs.project_name }} + shell: bash run: | cd plugin/ mkdir bundle/ @@ -62,7 +63,11 @@ jobs: '.[]|select((.mergedAt|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime)>($authortime|tonumber))| "* \(.title) by @\(.author.login) in #\(.number|tostring)"' \ >> CHANGELOG.md printf "\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${tag}...${version}\n" >> CHANGELOG.md - echo "changelog=$(cat CHANGELOG.md)" | tee -a "$GITHUB_OUTPUT" + r=$(cat CHANGELOG.md) # <--- Read release Notes + r="${r//'%'/'%25'}" # Multiline escape sequences for % + r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n' + r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r' + echo "RELEASE_BODY=$r" | tee -a $GITHUB_OUTPUT # <--- Set environment variable # gh release create "${version}" --latest \ # --title "${project_name} ${version}" \ # --notes-file CHANGELOG.md \ @@ -76,7 +81,7 @@ jobs: tag: ${{ steps.set_variables.outputs.version }} release_name: | ${{ steps.set_variables.outputs.project_name }} ${{ steps.set_variables.outputs.version }} - body: ${{ steps.bundle.outputs.changelog }} + body: ${{ steps.bundle.outputs.RELEASE_BODY }} file: plugin/bundle/${{ steps.set_variables.outputs.project_name }}.zip asset_name: ${{ steps.set_variables.outputs.project_name }}.zip overwrite: true From 81becb3da6743eae3bd635d8ca93e80288676ff1 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:57:30 +1200 Subject: [PATCH 54/56] 0.0.29: gh cleanup and final rel --- .github/workflows/release.yml | 4 ---- plugin/pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50e6a4e..d3da9d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,10 +68,6 @@ jobs: r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n' r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r' echo "RELEASE_BODY=$r" | tee -a $GITHUB_OUTPUT # <--- Set environment variable - # gh release create "${version}" --latest \ - # --title "${project_name} ${version}" \ - # --notes-file CHANGELOG.md \ - # "${project_name}.zip" - name: Create Release on Github if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 9cf292b..61e1d1d 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" # name = "bgutil-ytdlp-pot-provider" name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" # version = "0.2.1" -version = "0.2.28" +version = "0.2.29" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 62aa29032f5e249db6f707c1a35d9037c39b0fbc Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:03:41 +1200 Subject: [PATCH 55/56] Prepare to merge --- plugin/pyproject.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 61e1d1d..898a24e 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -3,10 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -# name = "bgutil-ytdlp-pot-provider" -name = "definitely_not_bgutil-ytdlp-pot-provider_to_distinguish_from_it" -# version = "0.2.1" -version = "0.2.29" +name = "bgutil-ytdlp-pot-provider" +version = "0.2.1" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" keywords = ["yt-dlp", "yt-dlp-plugin"] From 58eeae73949b26d12dc12ddb4cb7031196afdd63 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:12:26 +1200 Subject: [PATCH 56/56] [PyPI] add `yt-dlp-plugins-get-pot` keyword --- plugin/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml index 898a24e..883bc92 100644 --- a/plugin/pyproject.toml +++ b/plugin/pyproject.toml @@ -7,7 +7,7 @@ name = "bgutil-ytdlp-pot-provider" version = "0.2.1" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" -keywords = ["yt-dlp", "yt-dlp-plugin"] +keywords = ["yt-dlp", "yt-dlp-plugin", "yt-dlp-plugins-get-pot"] authors = [ { name = "Brainicism", email = "brainicism@gmail.com" }, ]