mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
Attach macOS and Linux binaries to release
This commit is contained in:
69
.github/workflows/build.yml
vendored
69
.github/workflows/build.yml
vendored
@@ -12,6 +12,7 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**/*.md'
|
- '**/*.md'
|
||||||
|
- '.github/*.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
|
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
|
||||||
@@ -21,7 +22,10 @@ defaults:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
###########################################################
|
||||||
build:
|
build:
|
||||||
|
###########################################################
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -29,8 +33,11 @@ jobs:
|
|||||||
- macos-latest
|
- macos-latest
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Git Checkout
|
- name: Git Checkout
|
||||||
uses: actions/checkout@v2 #https://github.com/actions/checkout
|
uses: actions/checkout@v2 #https://github.com/actions/checkout
|
||||||
|
|
||||||
@@ -83,15 +90,6 @@ jobs:
|
|||||||
pdm run app version
|
pdm run app version
|
||||||
pdm run app verify
|
pdm run app verify
|
||||||
|
|
||||||
- name: "Build docker image"
|
|
||||||
if: startsWith(matrix.os, 'linux')
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
bash docker/build-image.sh
|
|
||||||
|
|
||||||
docker run --rm kleinanzeigen-bot/kleinanzeigen-bot help
|
|
||||||
|
|
||||||
- name: "Install: binutils (strip)"
|
- name: "Install: binutils (strip)"
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
run: sudo apt-get --no-install-recommends install -y binutils
|
run: sudo apt-get --no-install-recommends install -y binutils
|
||||||
@@ -123,7 +121,6 @@ jobs:
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
- name: pyinstaller
|
- name: pyinstaller
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
@@ -132,17 +129,48 @@ jobs:
|
|||||||
|
|
||||||
ls -l dist
|
ls -l dist
|
||||||
|
|
||||||
- name: run kleinanzeigen_bot.exe
|
- name: run self-contained executable
|
||||||
if: startsWith(matrix.os, 'windows')
|
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
dist/kleinanzeigen-bot.exe help
|
dist/kleinanzeigen-bot help
|
||||||
dist/kleinanzeigen-bot.exe version
|
dist/kleinanzeigen-bot version
|
||||||
dist/kleinanzeigen-bot.exe verify
|
dist/kleinanzeigen-bot verify
|
||||||
|
|
||||||
|
- name: "Share: self-contained executable"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: artifacts-${{ matrix.os }}
|
||||||
|
path: dist/kleinanzeigen-bot*
|
||||||
|
|
||||||
|
- name: "Build docker image"
|
||||||
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
bash docker/build-image.sh
|
||||||
|
|
||||||
|
docker run --rm kleinanzeigen-bot/kleinanzeigen-bot help
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
publish-release:
|
||||||
|
###########################################################
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
concurrency: publish-latest-release # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "SCM Checkout"
|
||||||
|
# only required by "hub release create" to prevent "fatal: Not a git repository"
|
||||||
|
uses: actions/checkout@v2 #https://github.com/actions/checkout
|
||||||
|
|
||||||
|
- name: "Get: all build artifacts"
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
|
||||||
- name: "Delete previous 'latest' release"
|
- name: "Delete previous 'latest' release"
|
||||||
if: startsWith(matrix.os, 'windows') && github.ref == 'refs/heads/main'
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
@@ -163,17 +191,22 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: "Create 'latest' Release"
|
- name: "Create 'latest' Release"
|
||||||
if: startsWith(matrix.os, 'windows') && github.ref == 'refs/heads/main'
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
|
mv artifacts-macos-latest/kleinanzeigen-bot kleinanzeigen-bot-darwin-amd64
|
||||||
|
mv artifacts-ubuntu-latest/kleinanzeigen-bot kleinanzeigen-bot-linux-amd64
|
||||||
|
mv artifacts-windows-latest/kleinanzeigen-bot.exe kleinanzeigen-bot-windows-amd64.exe
|
||||||
|
|
||||||
# https://hub.github.com/hub-release.1.html
|
# https://hub.github.com/hub-release.1.html
|
||||||
hub release create "latest" \
|
hub release create "latest" \
|
||||||
--prerelease \
|
--prerelease \
|
||||||
--message "latest" \
|
--message "latest" \
|
||||||
--attach "dist/kleinanzeigen-bot.exe#kleinanzeigen-bot.exe"
|
--attach "kleinanzeigen-bot-darwin-amd64" \
|
||||||
|
--attach "kleinanzeigen-bot-linux-amd64" \
|
||||||
|
--attach "kleinanzeigen-bot-windows-amd64.exe"
|
||||||
|
|
||||||
- name: "Delete intermediate build artifacts"
|
- name: "Delete intermediate build artifacts"
|
||||||
uses: geekyeggo/delete-artifact@1-glob-support # https://github.com/GeekyEggo/delete-artifact/
|
uses: geekyeggo/delete-artifact@1-glob-support # https://github.com/GeekyEggo/delete-artifact/
|
||||||
|
|||||||
41
README.md
41
README.md
@@ -26,28 +26,47 @@ It is a spiritual successor to [AnzeigenOrg/ebayKleinanzeigen](https://github.co
|
|||||||
- use globbing (wildcards) to select images from local disk
|
- use globbing (wildcards) to select images from local disk
|
||||||
- reference categories by name (looked up from [categories.yaml](https://github.com/kleinanzeigen-bot/kleinanzeigen-bot/blob/main/kleinanzeigen_bot/resources/categories.yaml))
|
- reference categories by name (looked up from [categories.yaml](https://github.com/kleinanzeigen-bot/kleinanzeigen-bot/blob/main/kleinanzeigen_bot/resources/categories.yaml))
|
||||||
- logging is configurable and colorized
|
- logging is configurable and colorized
|
||||||
- provided as self-contained Windows executable [kleinanzeigen-bot.exe](https://github.com/kleinanzeigen-bot/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot.exe)
|
- provided as self-contained executable for Windows, Linux and macOS
|
||||||
- source code is pylint checked and uses Python type hints
|
- source code is pylint checked and uses Python type hints
|
||||||
- CI builds
|
- CI builds
|
||||||
|
|
||||||
|
|
||||||
## <a name="installation"></a>Installation
|
## <a name="installation"></a>Installation
|
||||||
|
|
||||||
### Installation on Windows using self-containing exe
|
### Installation using pre-compiled exe
|
||||||
|
|
||||||
1. The following components need to be installed:
|
1. The following components need to be installed:
|
||||||
1. [Chromium](https://www.chromium.org/getting-involved/download-chromium), [Google Chrome](https://www.google.com/chrome/),
|
1. [Chromium](https://www.chromium.org/getting-involved/download-chromium), [Google Chrome](https://www.google.com/chrome/),
|
||||||
or Chromium based [Microsoft Edge](https://www.microsoft.com/edge) browser
|
or Chromium based [Microsoft Edge](https://www.microsoft.com/edge) browser
|
||||||
|
|
||||||
1. Open a command/terminal window
|
1. Open a command/terminal window
|
||||||
1. Download the app using
|
|
||||||
```
|
1. Download and run the app by entering the following commands:
|
||||||
curl https://github.com/kleinanzeigen-bot/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot.exe -o kleinanzeigen-bot.exe
|
|
||||||
```
|
1. On Windows:
|
||||||
1. Run the app:
|
```batch
|
||||||
```
|
curl https://github.com/kleinanzeigen-bot/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot-windows-amd64.exe -o kleinanzeigen-bot.exe
|
||||||
kleinanzeigen-bot --help
|
|
||||||
```
|
kleinanzeigen-bot --help
|
||||||
|
```
|
||||||
|
|
||||||
|
1. On Linux:
|
||||||
|
```shell
|
||||||
|
curl https://github.com/kleinanzeigen-bot/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot-linux-amd64 -o kleinanzeigen-bot
|
||||||
|
|
||||||
|
chmod 655 kleinanzeigen-bot
|
||||||
|
|
||||||
|
./kleinanzeigen-bot --help
|
||||||
|
```
|
||||||
|
|
||||||
|
1. On macOS:
|
||||||
|
```shell
|
||||||
|
curl https://github.com/kleinanzeigen-bot/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot-darwin-amd64 -o kleinanzeigen-bot
|
||||||
|
|
||||||
|
chmod 655 kleinanzeigen-bot
|
||||||
|
|
||||||
|
./kleinanzeigen-bot --help
|
||||||
|
```
|
||||||
|
|
||||||
### Installation from source
|
### Installation from source
|
||||||
|
|
||||||
@@ -71,7 +90,7 @@ It is a spiritual successor to [AnzeigenOrg/ebayKleinanzeigen](https://github.co
|
|||||||
```bash
|
```bash
|
||||||
pip install pdm
|
pip install pdm
|
||||||
|
|
||||||
# temporary workaround for https://github.com/pdm-project/pdm/issues/728#issuecomment-1021771200
|
# temporary workaround for https://github.com/SeleniumHQ/selenium/issues/10022 / https://github.com/pdm-project/pdm/issues/728#issuecomment-1021771200
|
||||||
pip install -t __pypackages__/3.10/lib selenium
|
pip install -t __pypackages__/3.10/lib selenium
|
||||||
|
|
||||||
pdm install
|
pdm install
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ RUN cd /opt/app \
|
|||||||
&& ls -la . \
|
&& ls -la . \
|
||||||
# https://github.com/python/mypy/issues/11829
|
# https://github.com/python/mypy/issues/11829
|
||||||
&& pip install -t __pypackages__/3.10/lib git+git://github.com/python/mypy.git@9b3147701f054bf8ef42bd96e33153b05976a5e1 \
|
&& pip install -t __pypackages__/3.10/lib git+git://github.com/python/mypy.git@9b3147701f054bf8ef42bd96e33153b05976a5e1 \
|
||||||
# https://github.com/pdm-project/pdm/issues/728#issuecomment-1021771200
|
# https://github.com/SeleniumHQ/selenium/issues/10022 / https://github.com/pdm-project/pdm/issues/728#issuecomment-1021771200
|
||||||
&& pip install -t __pypackages__/3.10/lib selenium \
|
&& pip install -t __pypackages__/3.10/lib selenium \
|
||||||
&& pdm install \
|
&& pdm install \
|
||||||
&& ls -la kleinanzeigen_bot \
|
&& ls -la kleinanzeigen_bot \
|
||||||
|
|||||||
@@ -13,6 +13,34 @@ datas = [
|
|||||||
* collect_data_files("selenium_stealth"), # embeds *.js files
|
* collect_data_files("selenium_stealth"), # embeds *.js files
|
||||||
]
|
]
|
||||||
|
|
||||||
|
excluded_modules = [
|
||||||
|
"_aix_support",
|
||||||
|
"argparse",
|
||||||
|
"backports",
|
||||||
|
"bz2",
|
||||||
|
"cryptography.hazmat",
|
||||||
|
"distutils",
|
||||||
|
"doctest",
|
||||||
|
"ftplib",
|
||||||
|
"lzma",
|
||||||
|
"pep517",
|
||||||
|
"pdb",
|
||||||
|
"pip",
|
||||||
|
"pydoc",
|
||||||
|
"pydoc_data",
|
||||||
|
"optparse",
|
||||||
|
"setuptools",
|
||||||
|
"six",
|
||||||
|
"statistics",
|
||||||
|
"test",
|
||||||
|
"unittest",
|
||||||
|
"xml.sax"
|
||||||
|
]
|
||||||
|
|
||||||
|
from sys import platform
|
||||||
|
if platform != "darwin":
|
||||||
|
excluded_modules.append("_osx_support")
|
||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
analysis = Analysis(
|
analysis = Analysis(
|
||||||
@@ -24,30 +52,7 @@ analysis = Analysis(
|
|||||||
hookspath = [],
|
hookspath = [],
|
||||||
hooksconfig = {},
|
hooksconfig = {},
|
||||||
runtime_hooks = [],
|
runtime_hooks = [],
|
||||||
excludes = [
|
excludes = excluded_modules,
|
||||||
"_aix_support",
|
|
||||||
"_osx_support",
|
|
||||||
"argparse",
|
|
||||||
"backports",
|
|
||||||
"bz2",
|
|
||||||
"cryptography.hazmat",
|
|
||||||
"distutils",
|
|
||||||
"doctest",
|
|
||||||
"ftplib",
|
|
||||||
"lzma",
|
|
||||||
"pep517",
|
|
||||||
"pdb",
|
|
||||||
"pip",
|
|
||||||
"pydoc",
|
|
||||||
"pydoc_data",
|
|
||||||
"optparse",
|
|
||||||
"setuptools",
|
|
||||||
"six",
|
|
||||||
"statistics",
|
|
||||||
"test",
|
|
||||||
"unittest",
|
|
||||||
"xml.sax"
|
|
||||||
],
|
|
||||||
win_no_prefer_redirects = False,
|
win_no_prefer_redirects = False,
|
||||||
win_private_assemblies = False,
|
win_private_assemblies = False,
|
||||||
cipher = block_cipher,
|
cipher = block_cipher,
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ dev = [
|
|||||||
[tool.pdm.scripts]
|
[tool.pdm.scripts]
|
||||||
app = "python -m kleinanzeigen_bot"
|
app = "python -m kleinanzeigen_bot"
|
||||||
bandit = "bandit -c pyproject.toml -r kleinanzeigen_bot"
|
bandit = "bandit -c pyproject.toml -r kleinanzeigen_bot"
|
||||||
pyinstaller = "pyinstaller pyinstaller.spec --clean"
|
pyinstaller = "python -O -m PyInstaller pyinstaller.spec --clean"
|
||||||
pylint = "pylint kleinanzeigen_bot"
|
pylint = "pylint kleinanzeigen_bot"
|
||||||
pytest = "python -m pytest -v"
|
pytest = "python -m pytest -v"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Copyright (C) 2022 Sebastian Thomschke and contributors
|
Copyright (C) 2022 Sebastian Thomschke and contributors
|
||||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
"""
|
"""
|
||||||
import time
|
import os, sys, time
|
||||||
from kleinanzeigen_bot import utils
|
from kleinanzeigen_bot import utils
|
||||||
|
|
||||||
|
|
||||||
@@ -10,4 +10,7 @@ def test_pause():
|
|||||||
start = time.time()
|
start = time.time()
|
||||||
utils.pause(100, 100)
|
utils.pause(100, 100)
|
||||||
elapsed = 1000 * (time.time() - start)
|
elapsed = 1000 * (time.time() - start)
|
||||||
assert 99 < elapsed < 110
|
if sys.platform == "darwin" and os.getenv("GITHUB_ACTIONS", "true") == "true":
|
||||||
|
assert 99 < elapsed < 300
|
||||||
|
else:
|
||||||
|
assert 99 < elapsed < 110
|
||||||
|
|||||||
Reference in New Issue
Block a user