Skip to content

Commit

Permalink
🎨 尝试缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
wling-art committed Feb 9, 2024
1 parent d741754 commit 6b78641
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,61 @@ name: Build binaries and Upload to Release

on:
push:
branches: [main]
branches: [ main ]
paths:
- "version"
workflow_dispatch: {}

defaults:
run:
shell: bash

jobs:
build:
name: Build and Release
name: Build and Release for ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.11"]
python-version: ['3.11']

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Cache dependencies
- name: Cache Poetry
uses: actions/cache@v2
with:
path: ~/.poetry/cache
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
path: ~/.poetry
key: ${{ matrix.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
${{ matrix.os }}-poetry-
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Cache Dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ matrix.os }}-poetry-virtualenv-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-poetry-virtualenv-
- name: Install Dependencies
run: |
pip install poetry
poetry add pyinstaller
poetry config virtualenvs.create true
poetry install --no-root
poetry add pyinstaller
- name: Build
run: |
if [ "${{ runner.os }}" == 'Windows' ]; then
poetry run pyinstaller -F main.py -n ToolDelta.exe -i logo.png
else
poetry run pyinstaller -F main.py -n ToolDelta -i logo.png
fi
run: poetry run pyinstaller -F main.py -n ToolDelta${{ matrix.os == 'windows-latest' && '.exe' }} -i logo.ico

- name: Get version
run: echo "VERSION=$(<version)" >> $GITHUB_ENV
Expand Down

0 comments on commit 6b78641

Please sign in to comment.