-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.38 KB
/
release.yml
File metadata and controls
51 lines (42 loc) · 1.38 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
name: Release
on:
push:
branches: [main]
permissions:
contents: write # create tags + commits
pull-requests: write # comment on PRs
id-token: write # PyPI trusted publishing
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so semantic-release can walk commits
persist-credentials: true
token: ${{ secrets.AUTO_PR_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install pytest build python-semantic-release
- name: Run tests
run: pytest tests/ -q
- name: Release
env:
GH_TOKEN: ${{ secrets.AUTO_PR_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.AUTO_PR_TOKEN }}@github.com/node9-ai/node9-python.git
semantic-release version
- name: Build
run: |
pip install build twine
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/* --skip-existing