From 50f94ef3fc5e53bafe85a0313dca9c98d8d33770 Mon Sep 17 00:00:00 2001 From: Lukas Tenbrink Date: Mon, 1 Jul 2024 12:48:00 +0200 Subject: [PATCH] Update github script so that poetry actually installs. --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcb51d3..42c63e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,11 @@ on: tags: - release.** +env: + PYTHON_VERSION: "3.9" + POETRY_VERSION: "1.8.1" + POETRY_URL: https://install.python-poetry.org + jobs: build: strategy: @@ -15,16 +20,31 @@ jobs: - name: Check-out repository uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + id: setup_python + + # Poetry cache depends on OS, Python version and Poetry version. + - name: Cache Poetry cache + uses: actions/cache@v3 with: - python-version: "3.9" - - uses: Gr1N/setup-poetry@v8 - - uses: actions/cache@v2 + path: ~/.cache/pypoetry + key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }} + # virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files). + - name: Cache Packages + uses: actions/cache@v3 with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} - - run: poetry --version - + path: ~/.local + key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }} + - name: Install Poetry ${{ env.POETRY_VERSION }} + run: | + curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }} + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Dependencies + run: poetry install + - name: Build Executable uses: Nuitka/Nuitka-Action@main with: