A feature-rich command-line audio/video downloader
[build] Replace `set-output` with `GITHUB_OUTPUT` (#5315)
Lesmiscore7d61d2306e36
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 2b4e2f46b1..2a1b9a4aa0 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -21,7 +21,7 @@ jobs:env:PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }}if: "env.PUSH_VERSION_COMMIT == ''"- run: echo ::set-output name=version_suffix::$(date -u +"%H%M%S")+ run: echo "version_suffix=$(date -u +"%H%M%S")" >> "$GITHUB_OUTPUT"- name: Bump versionid: bump_versionrun: |@@ -36,7 +36,7 @@ jobs:git add -ugit commit -m "[version] update" -m "Created by: ${{ github.event.sender.login }}" -m ":ci skip all :ci run dl"git push origin --force ${{ github.event.ref }}:release- echo ::set-output name=head_sha::$(git rev-parse HEAD)+ echo "head_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"- name: Update masterenv:PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }}diff --git a/devscripts/update-version.py b/devscripts/update-version.pyindex caebf42414..9cf8b42e6f 100644--- a/devscripts/update-version.py+++ b/devscripts/update-version.py@@ -50,5 +50,7 @@ UPDATE_HINT = None'''write_file('yt_dlp/version.py', VERSION_FILE)-print(f'::set-output name=ytdlp_version::{VERSION}')+github_output = os.getenv('GITHUB_OUTPUT')+if github_output:+ write_file(github_output, f'ytdlp_version={VERSION}\n', 'a')print(f'\nVersion = {VERSION}, Git HEAD = {GIT_HEAD}')diff --git a/devscripts/utils.py b/devscripts/utils.pyindex aa17a5f7f6..b91b8e65a8 100644--- a/devscripts/utils.py+++ b/devscripts/utils.py@@ -7,8 +7,8 @@ def read_file(fname):return f.read()-def write_file(fname, content):- with open(fname, 'w', encoding='utf-8') as f:+def write_file(fname, content, mode='w'):+ with open(fname, mode, encoding='utf-8') as f:return f.write(content)