[workflows] release standalone executables in gdl-org/builds
needs some form of release notes, probably just git commits since last stable release
This commit is contained in:
60
.github/workflows/executables.yml
vendored
60
.github/workflows/executables.yml
vendored
@@ -1,10 +1,15 @@
|
|||||||
name: executables
|
name: Executables
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
tags-ignore:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
env:
|
||||||
|
DATE_FORMAT: "%Y.%m.%d"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -31,19 +36,58 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }}
|
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: ${{ matrix.architecture }}
|
architecture: ${{ matrix.architecture }}
|
||||||
|
|
||||||
|
- name: Date
|
||||||
|
run: echo "DATE=$(date '+${{ env.DATE_FORMAT }}')" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Update Version
|
||||||
|
# use Python since its behavior is consistent across operating systems
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import re
|
||||||
|
path = "./application/version.py"
|
||||||
|
with open(path) as fp:
|
||||||
|
content = fp.read()
|
||||||
|
content = re.sub(
|
||||||
|
r'\b(__version__ = "[^"]+)',
|
||||||
|
r"\1:${{ env.DATE }}",
|
||||||
|
content)
|
||||||
|
with open(path, "w") as fp:
|
||||||
|
fp.write(content)
|
||||||
|
|
||||||
- name: Build executable
|
- name: Build executable
|
||||||
run: |
|
run: |
|
||||||
pip install requests requests[socks] yt-dlp pyyaml ${{ matrix.python-packages }} pyinstaller
|
pip install requests requests[socks] yt-dlp pyyaml ${{ matrix.python-packages }} pyinstaller
|
||||||
python scripts/pyinstaller.py
|
python ./scripts/pyinstaller.py --os '${{ matrix.os }}' --arch '${{ matrix.architecture }}'
|
||||||
|
|
||||||
- name: Upload executable
|
- uses: actions/upload-artifact@v4
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: gallery-dl-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.python-version }}
|
name: executable-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.python-version }}
|
||||||
path: |
|
path: dist/*
|
||||||
dist
|
retention-days: 1
|
||||||
|
compression-level: 0
|
||||||
|
|
||||||
|
release:
|
||||||
|
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
|
||||||
|
- name: Date
|
||||||
|
run: echo "DATE=$(date '+${{ env.DATE_FORMAT }}')" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
owner: gdl-org
|
||||||
|
repo: builds
|
||||||
|
tag: ${{ env.DATE }}
|
||||||
|
artifacts: "executable-*/*"
|
||||||
|
allowUpdates: true
|
||||||
|
makeLatest: true
|
||||||
|
token: ${{ secrets.REPO_TOKEN }}
|
||||||
|
|||||||
2
.github/workflows/pages.yml
vendored
2
.github/workflows/pages.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
curl -L
|
curl -L
|
||||||
-X POST
|
-X POST
|
||||||
-H "Accept: application/vnd.github+json"
|
-H "Accept: application/vnd.github+json"
|
||||||
-H "Authorization: Bearer ${{ secrets.DISPATCH_TOKEN }}"
|
-H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}"
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28"
|
-H "X-GitHub-Api-Version: 2022-11-28"
|
||||||
https://api.github.com/repos/gdl-org/docs/actions/workflows/pages.yml/dispatches
|
https://api.github.com/repos/gdl-org/docs/actions/workflows/pages.yml/dispatches
|
||||||
-d '{"ref":"master"}'
|
-d '{"ref":"master"}'
|
||||||
|
|||||||
@@ -4,16 +4,34 @@
|
|||||||
"""Build a standalone executable using PyInstaller"""
|
"""Build a standalone executable using PyInstaller"""
|
||||||
|
|
||||||
import PyInstaller.__main__
|
import PyInstaller.__main__
|
||||||
|
import argparse
|
||||||
import util
|
import util
|
||||||
import os
|
import sys
|
||||||
|
|
||||||
PyInstaller.__main__.run([
|
|
||||||
"--onefile",
|
def main():
|
||||||
"--console",
|
parser = argparse.ArgumentParser()
|
||||||
"--name", "gallery-dl." + ("exe" if os.name == "nt" else "bin"),
|
parser.add_argument("-o", "--os")
|
||||||
"--additional-hooks-dir", util.path("scripts"),
|
parser.add_argument("-a", "--arch")
|
||||||
"--distpath", util.path("dist"),
|
args = parser.parse_args()
|
||||||
"--workpath", util.path("build"),
|
|
||||||
"--specpath", util.path("build"),
|
name = "gallery-dl"
|
||||||
util.path("gallery_dl", "__main__.py"),
|
if args.os:
|
||||||
])
|
name = "{}_{}".format(name, args.os.partition("-")[0].lower())
|
||||||
|
if args.arch == "x86":
|
||||||
|
name += "_x86"
|
||||||
|
|
||||||
|
PyInstaller.__main__.run([
|
||||||
|
"--onefile",
|
||||||
|
"--console",
|
||||||
|
"--name", name,
|
||||||
|
"--additional-hooks-dir", util.path("scripts"),
|
||||||
|
"--distpath", util.path("dist"),
|
||||||
|
"--workpath", util.path("build"),
|
||||||
|
"--specpath", util.path("build"),
|
||||||
|
util.path("gallery_dl", "__main__.py"),
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
|
|||||||
Reference in New Issue
Block a user