-
Notifications
You must be signed in to change notification settings - Fork 5
84 lines (72 loc) · 2.14 KB
/
release.yml
File metadata and controls
84 lines (72 loc) · 2.14 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
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
name: Release
on:
workflow_dispatch:
inputs:
version:
required: true
type: string
publish_doc:
description: 'If set to true, then the documentation will be published.'
default: false
required: false
type: boolean
publish_pypi:
default: false
type: boolean
description: "Attempt to publish packages to PyPI"
test:
default: true
description: "Run test release (no docs, publish to test.pypi.org)"
type: boolean
env:
PYMGCLIENT_OVERRIDE_VERSION: "${{ github.event.inputs.version }}"
jobs:
release_tests:
name: Release Package and Test
uses: "./.github/workflows/reusable_buildtest.yml"
with:
test_linux: true
test_windows: true
test_macintosh: true
build_source_dist: true
upload_artifacts: true
version: ${{ inputs.version }}
secrets: inherit
build_docs:
needs: [release_tests]
name: Build Docs
uses: "./.github/workflows/build_docs.yml"
with:
publish_doc: false
secrets: inherit
publish_artifacts:
name: Collect Artifacts
runs-on: ubuntu-24.04
needs: [release_tests, build_docs]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
# omit ‘name’ to fetch *every* artifact uploaded earlier
path: ./downloaded-artifacts
- name: Move Artifacts
run: |
mkdir -p dist
mv -v downloaded-artifacts/*/* dist/
- name: Show contents
run: |
ls dist/
- name: Publish Package to PyPI
if: ${{ inputs.publish_pypi == true && inputs.test == false }}
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish Package to PyPI (TEST)
if: ${{ inputs.publish_pypi == true && inputs.test }}
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
verbose: true