generated from yanyongyu/python-poetry-template
-
Notifications
You must be signed in to change notification settings - Fork 11
42 lines (34 loc) · 1.02 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Release
on:
push:
tags:
- v*
jobs:
publish-pypi-github:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/nonebot-plugin-send-anything-anywhere
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Setup Python environment
uses: ./.github/actions/setup-python
- run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: release-drafter/release-drafter@v5
with:
name: Release ${{ env.TAG_NAME }}
tag: ${{ env.TAG_NAME }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish PyPI and Github
run: |
poetry build
gh release upload --clobber ${{ env.TAG_NAME }} dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish pypi
uses: pypa/gh-action-pypi-publish@release/v1