nonebot2/.github/workflows/release.yml

68 lines
1.7 KiB
YAML
Raw Normal View History

2021-12-01 19:17:10 +00:00
name: Release
on:
2021-12-01 19:17:10 +00:00
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
2021-12-01 19:17:10 +00:00
ref: master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: "x64"
- uses: Gr1N/setup-poetry@v4
- uses: actions/cache@v1
with:
path: ~/.cache/pypoetry/virtualenvs
2021-11-22 15:31:03 +00:00
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
2021-12-02 06:03:06 +00:00
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Packages
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Set up dependencies
run: |
poetry install -E all
- name: Build Doc
run: poetry run sphinx-build -M markdown ./docs_build ./build
- name: Copy Files
2021-12-01 19:17:10 +00:00
run: cp -r ./build/markdown/* ./website/docs/api/
2021-12-01 19:17:10 +00:00
- name: Archive Files
2021-12-02 06:03:06 +00:00
run: |
yarn install
yarn archive $(poetry version -s)
2021-12-01 19:17:10 +00:00
- name: Push Tag and Release to PyPI
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m ":bookmark: Release $(poetry version -s)"
git tag v$(poetry version -s)
git push --tags
poetry build
poetry publish -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.PYPI_PASSWORD}}