Skip to content

Commit

Permalink
Merge pull request #9607 from freqtrade/new_release
Browse files Browse the repository at this point in the history
New release 2023.12
  • Loading branch information
xmatthias committed Dec 30, 2023
2 parents 0654186 + 846b773 commit 5c8c53c
Show file tree
Hide file tree
Showing 81 changed files with 3,881 additions and 1,118 deletions.
135 changes: 85 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -44,7 +44,6 @@ jobs:

- name: pip cache (linux)
uses: actions/cache@v3
if: runner.os == 'Linux'
with:
path: ~/.cache/pip
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
Expand All @@ -55,7 +54,6 @@ jobs:
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
- name: Installation - *nix
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip wheel
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
Expand Down Expand Up @@ -122,18 +120,18 @@ jobs:
details: Freqtrade CI failed on ${{ matrix.os }}
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

build_macos:
build-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest ]
os: [ "macos-latest", "macos-13" ]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand All @@ -143,39 +141,42 @@ jobs:
id: cache
with:
path: ~/dependencies/
key: ${{ runner.os }}-dependencies
key: ${{ matrix.os }}-dependencies

- name: pip cache (macOS)
uses: actions/cache@v3
if: runner.os == 'macOS'
with:
path: ~/Library/Caches/pip
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip

- name: TA binary *nix
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
- name: Installation - macOS
if: runner.os == 'macOS'
run: |
# brew update
# TODO: Should be the brew upgrade
# homebrew fails to update python due to unlinking failures
# https://github.com/actions/runner-images/issues/6817
rm /usr/local/bin/2to3 || true
rm /usr/local/bin/2to3-3.11 || true
rm /usr/local/bin/2to3-3.12 || true
rm /usr/local/bin/idle3 || true
rm /usr/local/bin/idle3.11 || true
rm /usr/local/bin/idle3.12 || true
rm /usr/local/bin/pydoc3 || true
rm /usr/local/bin/pydoc3.11 || true
rm /usr/local/bin/pydoc3.12 || true
rm /usr/local/bin/python3 || true
rm /usr/local/bin/python3.11 || true
rm /usr/local/bin/python3.12 || true
rm /usr/local/bin/python3-config || true
rm /usr/local/bin/python3.11-config || true
rm /usr/local/bin/python3.12-config || true
brew install hdf5 c-blosc
brew install hdf5 c-blosc libomp
python -m pip install --upgrade pip wheel
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
Expand Down Expand Up @@ -231,7 +232,7 @@ jobs:
details: Test Succeeded!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

build_windows:
build-windows:

runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -243,7 +244,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -301,13 +302,13 @@ jobs:
details: Test Failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

mypy_version_check:
mypy-version-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand All @@ -321,12 +322,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: pre-commit/action@v3.0.0

docs_check:
docs-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -336,7 +337,7 @@ jobs:
./tests/test_docs.sh
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand All @@ -362,9 +363,9 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.11"

- name: Cache_dependencies
uses: actions/cache@v3
Expand All @@ -375,7 +376,6 @@ jobs:

- name: pip cache (linux)
uses: actions/cache@v3
if: runner.os == 'Linux'
with:
path: ~/.cache/pip
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
Expand All @@ -386,7 +386,6 @@ jobs:
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
- name: Installation - *nix
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip wheel
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
Expand All @@ -399,17 +398,17 @@ jobs:
env:
CI_WEB_PROXY: http://152.67.78.211:13128
run: |
pytest --random-order --cov=freqtrade --cov-config=.coveragerc --longrun
pytest --random-order --longrun --durations 20 -n auto --dist loadscope
# Notify only once - when CI completes (and after deploy) in case it's successfull
notify-complete:
needs: [
build_linux,
build_macos,
build_windows,
docs_check,
mypy_version_check,
build-macos,
build-windows,
docs-check,
mypy-version-check,
pre-commit,
build_linux_online
]
Expand All @@ -436,44 +435,79 @@ jobs:
details: Test Completed!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

deploy:
needs: [ build_linux, build_macos, build_windows, docs_check, mypy_version_check, pre-commit ]
build:
name: "Build"
needs: [ build_linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ]
runs-on: ubuntu-22.04

if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade'

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
id: extract_branch

- name: Build distribution
run: |
pip install -U setuptools wheel
python setup.py sdist bdist_wheel
pip install -U build
python -m build --sdist --wheel
- name: Upload artifacts 📦
uses: actions/upload-artifact@v4
with:
name: freqtrade-build
path: |
dist
retention-days: 10

deploy-pypi:
name: "Deploy to PyPI"
needs: [ build ]
runs-on: ubuntu-22.04
if: (github.event_name == 'release')
environment:
name: release
url: https://pypi.org/p/freqtrade
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Download artifact 📦
uses: actions/download-artifact@v4
with:
name: freqtrade-build
path: dist

- name: Publish to PyPI (Test)
uses: pypa/gh-action-pypi-publish@v1.8.10
if: (github.event_name == 'release')
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
user: __token__
password: ${{ secrets.pypi_test_password }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
if: (github.event_name == 'release')
uses: pypa/gh-action-pypi-publish@v1.8.11


deploy-docker:
needs: [ build_linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ]
runs-on: ubuntu-22.04

if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade'

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
user: __token__
password: ${{ secrets.pypi_password }}
python-version: "3.11"

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
id: extract_branch

- name: Dockerhub login
env:
Expand Down Expand Up @@ -506,10 +540,11 @@ jobs:
run: |
build_helpers/publish_docker_multi.sh
deploy_arm:
deploy-arm:
name: "Deploy Docker"
permissions:
packages: write
needs: [ deploy ]
needs: [ deploy-docker ]
# Only run on 64bit machines
runs-on: [self-hosted, linux, ARM64]
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade'
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Pre-commit auto-update

on:
# every day at midnight
schedule:
- cron: "0 3 * * 2"
# on demand
workflow_dispatch:

permissions:
contents: read

jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"


- name: Install pre-commit
run: pip install pre-commit

- name: Run auto-update
run: pre-commit autoupdate

- name: Run pre-commit
run: pre-commit run --all-files

- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
add-paths: .pre-commit-config.yaml
labels: |
Tech maintenance
branch: update/pre-commit-hooks
title: Update pre-commit hooks
commit-message: "chore: update pre-commit hooks"
committer: Freqtrade Bot <noreply@github.com>
body: Update versions of pre-commit hooks to latest version.
delete-branch: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ target/
#exceptions
!*.gitkeep
!config_examples/config_binance.example.json
!config_examples/config_bittrex.example.json
!config_examples/config_full.example.json
!config_examples/config_kraken.example.json
!config_examples/config_freqai.example.json

0 comments on commit 5c8c53c

Please sign in to comment.