-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (78 loc) · 2.1 KB
/
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
84
85
86
87
name: Python Package
on:
workflow_dispatch:
inputs:
push:
description: Push the artifact to PyPi?
default: false
type: boolean
tag:
description: Tag to push
required: true
type: string
workflow_call:
inputs:
push:
description: Push the artifact to PyPi?
default: true
type: boolean
tag:
description: Tag to push
required: true
type: string
outputs:
version:
description: The true version of the package
value: ${{ jobs.package.outputs.version }}
secrets:
PYPI_API_TOKEN:
description: PyPi token
required: true
GH_APP_KEY:
description: GitHub App private key
required: true
jobs:
package:
name: Package
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/duplocloud-client
outputs:
version: ${{ steps.check_version.outputs.version }}
steps:
- name: Setup
uses: duplocloud/duploctl/.github/actions/setup@main
with:
ref: ${{ inputs.tag }}
install: ".[build]"
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
- name: Check True Version
id: check_version
run: |
version=$(python -m setuptools_scm)
package="duplocloud_client-${version}"
echo "Building Version: $version"
echo "version=$version" >> $GITHUB_OUTPUT
echo "package=$package" >> $GITHUB_OUTPUT
- name: Run the Build
run: python -m build
- name: Show Files
run: ls -l dist
- name: Publish Package to PyPI
if: inputs.push == true
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Build the Plugins
run: |
for d in ./plugins/*; do
python -m build "$d" -o=dist
done
ls -l dist
- name: Github Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.check_version.outputs.package }}
path: dist/*.tar.gz