-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.74 KB
/
python-publish.yml
File metadata and controls
58 lines (52 loc) · 1.74 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
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
name: upload release to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set up Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "npm"
- name: Enable Corepack
run: |
npm install -g corepack
corepack enable
corepack prepare yarn --activate
- name: Yarn run install
run: |
yarn install --immutable
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
python -m pip install -r requirements.txt -r requirements-dev.txt
- name: Use Yarn to build component
run: |
yarn build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1