forked from deephaven/deephaven-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.14 KB
/
release-python-package.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release Python Package
on:
workflow_call:
inputs:
package:
required: true
type: string
jobs:
test:
uses: ./.github/workflows/test-python-package.yml
with:
package: ${{ inputs.package }}
build-plugin:
needs: test
uses: ./.github/workflows/build-python-package.yml
with:
package: ${{ inputs.package }}
release:
needs: build-plugin
runs-on: ubuntu-22.04
permissions:
id-token: write
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download dist
uses: actions/download-artifact@v3
with:
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/
- name: Get the name of the whl file
id: get_whl
run: |
WHL_DIR=plugins/${{ inputs.package }}/dist/
WHL_FILE=$(ls $WHL_DIR | grep .whl)
echo "whl_path=${WHL_DIR}${WHL_FILE}" >> $GITHUB_OUTPUT
- name: Install pkginfo
run: pip install pkginfo
- name: Extract package version
id: extract_version
run: |
VERSION=$(python -c 'import pkginfo; print(pkginfo.Wheel("${{ steps.get_whl.outputs.whl_path }}").version)')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: plugins/${{ inputs.package }}/dist/
check-make-docs:
runs-on: ubuntu-22.04
outputs:
files_exists: ${{ steps.check_files.outputs.files_exists }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "plugins/${{ inputs.package }}/make_docs.py"
release-docs:
if: needs.check-make-docs.outputs.files_exists == 'true'
needs:
- release
- check-make-docs
uses: ./.github/workflows/make-docs.yml
secrets: inherit
with:
package: ${{ inputs.package }}
version: ${{ needs.release.outputs.version }}