mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-05 19:36:43 +08:00
ci: 添加发布至 PyPI
This commit is contained in:
parent
743d863e13
commit
024fcda219
40
.github/actions/setup-python/action.yml
vendored
Normal file
40
.github/actions/setup-python/action.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
name: Setup Python
|
||||
description: Setup Python
|
||||
|
||||
inputs:
|
||||
python-version:
|
||||
description: Python version
|
||||
required: false
|
||||
default: "3.9"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
|
||||
- name: Install poetry
|
||||
uses: Gr1N/setup-poetry@v7
|
||||
|
||||
- name: Cache Windows dependencies
|
||||
uses: actions/cache@v2
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
with:
|
||||
path: ~/AppData/Local/pypoetry/Cache/virtualenvs
|
||||
key: ${{ runner.os }}-poetry-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
- name: Cache Linux dependencies
|
||||
uses: actions/cache@v2
|
||||
if: ${{ runner.os == 'Linux' }}
|
||||
with:
|
||||
path: ~/.cache/pypoetry/virtualenvs
|
||||
key: ${{ runner.os }}-poetry-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
- name: Cache macOS dependencies
|
||||
uses: actions/cache@v2
|
||||
if: ${{ runner.os == 'macOS' }}
|
||||
with:
|
||||
path: ~/Library/Caches/pypoetry/virtualenvs
|
||||
key: ${{ runner.os }}-poetry-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
@ -1,4 +1,4 @@
|
||||
name: Code Coverage
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -51,7 +51,7 @@ jobs:
|
||||
path: ./src/plugins/nonebot_bison/admin_page/dist
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: he0119/setup-python@v0.1.0
|
||||
uses: ./.github/actions/setup-python
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
38
.github/workflows/release.yml
vendored
Normal file
38
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build-frontend:
|
||||
name: Build Frontend
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Build Frontend
|
||||
uses: ./.github/actions/build-frontend
|
||||
|
||||
- name: Upload dist
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: frontend
|
||||
path: ./admin-frontend/build/
|
||||
publish-pypi:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Download frontend files
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: frontend
|
||||
path: ./src/plugins/nonebot_bison/admin_page/dist
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: ./.github/actions/setup-python
|
||||
|
||||
- name: Publish PyPI
|
||||
run: poetry publish --build -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} || echo "Already pushed to pypi"
|
Loading…
x
Reference in New Issue
Block a user