-
Notifications
You must be signed in to change notification settings - Fork 24
46 lines (40 loc) · 1.57 KB
/
Publish_RAFT.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
43
44
45
46
name: Build and upload to PyPI
# Build on every branch push, tag push, and pull request change:
#on: [push, pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
push:
pull_request:
release:
types:
- published
jobs:
build_and_upload_pypi:
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
# upload to PyPI on every tag starting with 'v'
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
id: cp
with:
python-version: "3.11"
update-environment: true
- name: Install pypa/build
run: |
python -m pip install build
- name: Build a binary wheel and a source tarball
run: |
python -m build .
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/