Repository navigation
76 lines (72 loc) · 2.52 KB
/
Copy pathrelease.yml
File metadata and controls
76 lines (72 loc) · 2.52 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Publish to PyPI
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
test:
if: github.event.deleted == false
permissions:
contents: read
uses: ./.github/workflows/ci.yml
build:
needs: test
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: '3.x'
- name: Build wheel and source distribution
run: |
# PyPI readers should see the documentation from this release.
sed -i "s|github.com/tiyee/wechat-sdk-python/blob/master/docs/|github.com/tiyee/wechat-sdk-python/blob/$GITHUB_SHA/docs/|g" README.md
python -m pip install build
python -m build
- name: Verify tag and distribution versions
run: python .github/scripts/verify_release.py "$GITHUB_REF_NAME"
- name: Smoke test the installed wheel
working-directory: ${{ runner.temp }}
run: |
python -m venv wheel-smoke
wheel-smoke/bin/python -Im pip install "$GITHUB_WORKSPACE"/dist/*.whl
wheel-smoke/bin/python -Im pip check
wheel-smoke/bin/python -I - <<'PY'
from wechat_sdk.channels import ChannelsClient
from wechat_sdk.miniapp import MiniAppClient
from wechat_sdk.miniapp.api.virtual_payment.orders import OrdersAPI
from wechat_sdk.miniapp.models.virtual_payment.orders import CurrencyPayRequest
from wechat_sdk.official_account import OfficialAccountClient
from wechat_sdk.pay import PayV2Client, PayV3Client
from wechat_sdk.pay.aipay import X402Client
from wechat_sdk.store import StoreClient
from wechat_sdk.store.models.category import LicenseField
from wechat_sdk.work import (
WorkBotClient, WorkClient, WorkCustomizedClient,
WorkHardwareClient, WorkProviderClient, WorkThirdPartyClient,
)
PY
- uses: actions/upload-artifact@v7
with:
name: distributions
path: dist/
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/wechat-sdk-python/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
name: distributions
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1