[version] add __variant__

Specifies origin and OS of executable files.
For example 'stable/windows'.
This commit is contained in:
Mike Fährmann
2024-05-27 21:37:01 +02:00
parent 020050ea8b
commit 601f5becc8
5 changed files with 39 additions and 11 deletions

View File

@@ -42,7 +42,9 @@ jobs:
architecture: ${{ matrix.architecture }}
- name: Date
run: echo "DATE=$(date '+${{ env.DATE_FORMAT }}')" >> "$GITHUB_ENV"
run: |
echo "DATE=$(date '+${{ env.DATE_FORMAT }}')" >> "$GITHUB_ENV"
echo "LABEL=$(python ./scripts/pyinstaller.py --print --os '${{ matrix.os }}' --arch '${{ matrix.architecture }}')" >> "$GITHUB_ENV"
- name: Update Version
# use Python since its behavior is consistent across operating systems
@@ -56,13 +58,17 @@ jobs:
r'\b(__version__ = "[^"]+)',
r"\1:${{ env.DATE }}",
content)
content = re.sub(
r'\b(__variant__ =).+',
r'\1 "dev/${{ env.LABEL }}"',
content)
with open(path, "w") as fp:
fp.write(content)
- name: Build executable
run: |
pip install requests requests[socks] yt-dlp pyyaml ${{ matrix.python-packages }} pyinstaller
python ./scripts/pyinstaller.py --os '${{ matrix.os }}' --arch '${{ matrix.architecture }}'
python ./scripts/pyinstaller.py --label '${{ env.LABEL }}'
- uses: actions/upload-artifact@v4
with: