From 312847fb6a69745c7f5095ba48b251bb2cbb9e24 Mon Sep 17 00:00:00 2001 From: felinae98 <731499577@qq.com> Date: Sun, 8 Jan 2023 19:11:54 +0800 Subject: [PATCH] :construction_worker: change poetry install action --- .github/actions/setup-python/action.yml | 18 ++++++++++++++++++ .github/workflows/main.yml | 2 +- .github/workflows/release-trigger.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .github/actions/setup-python/action.yml diff --git a/.github/actions/setup-python/action.yml b/.github/actions/setup-python/action.yml new file mode 100644 index 0000000..bb29778 --- /dev/null +++ b/.github/actions/setup-python/action.yml @@ -0,0 +1,18 @@ +name: Setup Python +description: Setup Python + +inputs: + python-version: + description: Python version + required: false + default: "3.10" + +runs: + using: "composite" + steps: + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + - name: install poetry + uses: abatilo/actions-poetry@v2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa325fb..0ef9fa1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup Python environment - uses: he0119/setup-python@79c04f1e1bcbfe45c9d0eca6aa522e9b364d7dfa + uses: ./.github/actions/setup-python with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/release-trigger.yml b/.github/workflows/release-trigger.yml index 00dc059..febf993 100644 --- a/.github/workflows/release-trigger.yml +++ b/.github/workflows/release-trigger.yml @@ -14,7 +14,7 @@ jobs: token: ${{ secrets.GH_PAT }} - name: Setup Python environment - uses: he0119/setup-python@79c04f1e1bcbfe45c9d0eca6aa522e9b364d7dfa + uses: ./.github/actions/setup-python - run: echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f79f65c..b7c21b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: path: ./src/plugins/nonebot_bison/admin_page/dist - name: Setup Python environment - uses: he0119/setup-python@79c04f1e1bcbfe45c9d0eca6aa522e9b364d7dfa + uses: ./.github/actions/setup-python - run: | echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV