-
Notifications
You must be signed in to change notification settings - Fork 44
55 lines (52 loc) · 1.42 KB
/
publish.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
47
48
49
50
51
52
53
54
55
name: Publish
on: [pull_request]
jobs:
build-python-package:
strategy:
matrix:
component:
- "Common"
- "Client"
name: Build python package
runs-on: ubuntu-latest
outputs:
hash: ${{ steps.hash.outputs.hash }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install python dependencies
run: pip install --upgrade pip && pip install build
- name: Build python package
run: cd ${{ matrix.component }} && python -m build
- name: Generate hash
id: hash
run: cd ${{ matrix.component }}/dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
- name: Upload python artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ matrix.component }}/dist
name: artifact-${{ matrix.component }}
publish-python-package:
needs:
- "build-python-package"
strategy:
matrix:
component:
- "Common"
- "Client"
name: Upload package to PyPI
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifact-${{ matrix.component }}
- name: Display structure of downloaded files
run: ls -R