-
Notifications
You must be signed in to change notification settings - Fork 15
41 lines (39 loc) · 1.08 KB
/
on_release.yml
File metadata and controls
41 lines (39 loc) · 1.08 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
name: Publish the Package onto PyPI
on:
release:
types:
- published
workflow_call:
inputs:
package_name:
required: true
type: string
requirements:
type: string
jobs:
env0:
if: ${{ github.event_name != 'workflow_call' }}
uses: ./.github/workflows/env0.yml
execute:
name: Prepare and Publish Package
needs: env0
env:
PKG_NAME: ${{ inputs.package_name || needs.env0.outputs.package_name }}
PKG_REQS: ${{ inputs.requirements || needs.env0.outputs.requirements }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wavefrontHQ/wavefront-sdk-python/.github/actions/lint_n_test@master
with:
input_pkg_name: ${{ env.PKG_NAME }}
extra_packages: ${{ env.PKG_REQS }} build
- name: Build Package
run: python -m build
shell: bash
- name: Publish Package on PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}