-
Notifications
You must be signed in to change notification settings - Fork 164
66 lines (56 loc) · 1.8 KB
/
wheel-publisher.yml
File metadata and controls
66 lines (56 loc) · 1.8 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
# SPDX-FileCopyrightText: 2025 Howetuft
#
#
# SPDX-License-Identifier: Apache-2.0
# This workflow publishes a release to Pypi (or Pypi test)
name: LuxCore Python Wheels Publisher
on:
workflow_dispatch:
inputs:
release-tag:
description: "Version of the release to publish (major.minor.patch[-rev])"
required: True
default: 0.0.1
type: string
test:
description: "Publish on Pypi test"
required: True
default: True
type: boolean
jobs:
publish-wheels:
name: Publish release '${{ inputs.release-tag }}'
runs-on: ubuntu-latest
environment:
name: ${{ inputs.test && 'testpypi' || 'pypi' }}
url: ${{ inputs.test && 'https://test.pypi.org/p/pyluxcore' || 'https://pypi.org/p/pyluxcore' }}
env:
GH_TOKEN: ${{ github.token }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Download wheels from release '${{ inputs.release-tag }}'
shell: bash
run: |
# Warning: Target release must not be in 'draft' status,
# otherwise gh release won't find it
gh release download wheels-v${{ inputs.release-tag}} -D tmp -R LuxCoreRender/LuxCore
mkdir dist
for d in tmp/*.zip ; do
echo "unzip ${d}"
unzip ${d} -d dist
done
ls -Rl dist
- name: Publish package distributions to PyPI test
if: inputs.test
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
verify-metadata: true
skip-existing: true
- name: Publish package distributions to PyPI
if: ${{ ! inputs.test }}
uses: pypa/gh-action-pypi-publish@release/v1