From abe29457f2380932d070bfd607c8ab5f749627c3 Mon Sep 17 00:00:00 2001 From: PeriniM Date: Thu, 2 Jan 2025 18:38:47 +0100 Subject: [PATCH] fix: workflow --- .github/workflows/release.yml | 42 +++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbf16129..a0fd18ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,44 +14,44 @@ jobs: run: | sudo apt update sudo apt install -y git + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install uv uses: astral-sh/setup-uv@v3 + - name: Install Node Env uses: actions/setup-node@v4 with: node-version: 20 + - name: Checkout uses: actions/checkout@v4.1.1 with: fetch-depth: 0 persist-credentials: false - - name: Create Virtual Environment + + - name: Build and validate package run: | uv venv - - name: Activate Virtual Environment and Install Dependencies - run: | - source .venv/bin/activate # For Linux/macOS. Use .venv\Scripts\activate for Windows - uv sync --frozen + . .venv/bin/activate uv pip install --upgrade setuptools wheel hatchling twine - - name: Build app - run: | - source .venv/bin/activate # Activate the virtual environment again if needed + uv sync --frozen + uv pip install -e . uv build - id: build_cache - if: success() - - name: Validate Metadata - run: | - source .venv/bin/activate uv run twine check dist/* + - name: Debug Dist Directory - run: | - ls -al dist + run: ls -al dist + - name: Cache build uses: actions/cache@v3 with: path: ./dist key: ${{ runner.os }}-build-${{ github.sha }} - if: steps.build_cache.outputs.id != '' release: name: Release @@ -73,9 +73,13 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - name: Restore Virtual Environment - run: | - source .venv/bin/activate + + - name: Restore build artifacts + uses: actions/cache@v3 + with: + path: ./dist + key: ${{ runner.os }}-build-${{ github.sha }} + - name: Semantic Release uses: cycjimmy/semantic-release-action@v4.1.0 with: